VS 2012 で Windows Phone プロジェクトを実行すると、次のエラーが発生しました。
{System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
File name: 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
at MobileConnection.SSCClient.SSCConnection.GetHostNameAndPort()
at MobileConnection.SSCClient.SSCConnection.InitializeSSCConnection(Boolean runningState)}
.csproj ファイルの対応するエントリは次のとおりです。
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\sl4-windowsphone71\Newtonsoft.Json.dll</HintPath>
</Reference>
そして、packages.config で:
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="wp80" />
しばらくデバッグし、nuget を介して newtonsoft.json パッケージを再インストールしました。
しかし、私にとってうまくいった解決策は、「プライベート」プロパティを「True」に設定することです。
.csproj ファイルの更新されたエントリ:
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\sl4-windowsphone71\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
それがどのように機能したか、または問題が何であったかを理解できません。msdn のドキュメントに関する説明は、 http://msdn.microsoft.com/en-us/library/vstudio/bb629388.aspxにもあまり役に立ちませんでした。