2017-07-05 2 views
1

これは私が使用したコードです。 そしてMicrosoft.SharePoint.dllを追加しました。ファイルまたはアセンブリをロードできませんでした 'Microsoft.SharePoint、バージョン= 15.0.0.0

Could not load file or assembly 'Microsoft.SharePoint, Version=15.0.0.0, 
Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. 
The system cannot find the file specified. 
+1

あなたはSharepoint Dllのそのバージョンですか? – SCramphorn

答えて

1

1)プロジェクト内の参照を確認してください:

using Microsoft.SharePoint.Client; 
using System.Web.Script.Serialization; 
using Microsoft.SharePoint; 

    class 
    {   
     SPSite site = new SPSite(siteUrl); 
    } 

エラーがこの のように示しています。 Microsoft.SharePointリファレンスはありますか?

2)参照があっても破損していない場合は、ライブラリのプロパティを開いてバージョンを確認してください。

2.1)より新しいバージョンを参照している場合は、例えば、アプリの設定でbindingRedirectとの結合アセンブリを追加します。

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
    <dependentAssembly> 
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> 
    <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" /> 
    </dependentAssembly> 
</assemblyBinding> 

3)はフュージョンログHow to enable assembly bind failure logging (Fusion) in .NETを有効にし、ログを読み取ります。

+0

このファイルをC:\ Windows \ Microsoft.NET \ assembly \ GAC_MSIL \ Microsoft.SharePoint.Client.Runtime \ v4.0_15.0.0.0__71e9bce111e9429c \ Microsoft.SharePoint.Client.Runtime.dllに保存する必要がありますか。 –

+0

私はフォルダを変更します。それは動作しません。 –

関連する問題