【发布时间】:2017-09-28 05:54:06
【问题描述】:
最近我试图创建一个提供商托管的应用程序来在线共享点。 我已经配置了 Azure Web 应用程序并创建了应用程序并将其发布到在线共享点。我现在可以在 SharePoint 在线应用程序目录中看到该应用程序。但是当我尝试运行应用程序时,它会抛出以下错误。
System.IO.FileNotFoundException: msoidcliL.dll at Microsoft.SharePoint.Client.Idcrl.IdcrlNativeMethodsSelector..ctor(String dllPath) at Microsoft.SharePoint.Client.Idcrl.ManagedIdcrl.get_IdcrlNativeMethods() at Microsoft.SharePoint.Client.Idcrl.ManagedIdcrl.EnsureInited() at Microsoft.SharePoint.Client.Idcrl.ManagedIdcrl.LogonIdentity(String username, SecureString password) at Microsoft.SharePoint.Client.Idcrl.SharePointOnlineAuthenticationProvider.Logon(String username, SecureString password) at Microsoft.SharePoint.Client.SharePointOnlineCredentials..ctor(String username, SecureString password) at SharePointApp5Web.Default.Page_Load(Object sender, EventArgs e)
代码
var spContext = SharePointContextProvider.Current.GetSharePointContext(Context);
try
{
string str;
using (ClientContext ctx = new ClientContext("https://mydomain.sharepoint.com/sites/General/Community%20Portal/HR/Acknowledgements"))
{
ctx.Credentials = new Microsoft.SharePoint.Client.SharePointOnlineCredentials("myname@domain.com", ConvertToSecureString("password"));
Web myweb = ctx.Web;
List myList = myweb.Lists.GetByTitle("Timesheet Administration Policy");
ListItemCreationInformation ItemCreationInfo = new ListItemCreationInformation();
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml =
@"<Query>
<Where>
<Neq>
<FieldRef Name='ID' />
<Value Type='Counter'>946</Value>
</Neq>
</Where>
</Query>";
Microsoft.SharePoint.Client.ListItemCollection listItems = myList.GetItems(camlQuery);
ctx.Load(listItems);
ctx.ExecuteQuery();
foreach (Microsoft.SharePoint.Client.ListItem listItem in listItems.ToList())
{
try
{
Response.Write(listItem["Email_x0020_Address"].ToString().Trim());
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
}
}
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
【问题讨论】:
标签: azure sharepoint sharepoint-online