سؤال

أواجه مشكلات لإجراء تشغيله وأراد أن أسألك إذا كنت تعرف إذا كان من الممكن استخدام CSOM في حلول مزرعة SP 2013؟

أحصل باستمرار على استثناء 401 غير مصرح به.

هنا هو كيف أقوم بإنشاء العميل الخاص بك: giveacodicetagpre.

كما أريد مشاركة الرمز بين تطبيق SharePoint AutoHosted وحل المزرعة لدي لاستخدام CSOM.

هل كانت مفيدة؟

المحلول

This won't work because of internal security checks of SharePoint, and deactivating them isn't recommended.

Therefore you abstract your main code and create a semi intelligent data binding layer in your class to load the data. Dynamically loading in the required namespace for reading in the data, by using reflection.

System.Reflection.Assembly asmbly;
asmbly = System.Reflection.Assembly.Load("Microsoft.SharePoint")

object clss;
clss = asb.CreateInstance("Microsoft.SharePoint.Foo")

Yes it would be a little more code, but if you abstract it properly and load the data into a List for example, then this code will be minimal.

Reference - Dynamic Namespace Imports and Switching:

http://www.codeproject.com/Articles/32828/Using-Reflection-to-load-unreferenced-assemblies-a

http://www.debenu.com/kb/switching-between-the-32-bit-and-64-bit-dll-versions-of-debenu-quick-pdf-library/

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top