最近、プロバイダをホストしてオンラインでポイントを共有するアプリケーションを作成しようとしていました。 私はAzureのWebアプリケーションを設定し、そのアプリケーションを作成してオンラインで共有ポイントに公開しました。私は今、SharePointオンラインアプリカタログでアプリを見ることができます。アプリケーションを実行しようとすると、以下のエラーがスローされます。プロバイダのホストされたアプリケーションを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("[email protected]", 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());
}
あなたもこのライン 'ctx.AuthenticationMode = ClientAuthenticationMode.Defaultを追加できるように行われますが – Rinu
上記と同じエラーを得た;' '下回りますctx.Credentials'行とチェック?また、プロジェクトが.Netフレームワーク4.5にターゲット設定され、プラットフォームターゲットが '' Any CPU'に設定されていることを確認してください。そのv16アセンブリを確認してください –
チャームのように働いた! :)。あなたは答えを更新できますか?私はそれを答えとしてマークすることができます。 – Rinu