【发布时间】:2016-05-21 22:17:37
【问题描述】:
我的 web projectA 引用了我的 projectB,它引用了 Microsoft.AspNet.WebApi.Client,它引用了 Newtonsoft.Json 程序集。它没有在其他任何地方引用。问题是,在我的部署服务器上,Newtonsoft.Json 运行后没有复制到bin 目录
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe .\src\path.to.Web.projectA.csproj /t:Rebuild /p:Configuration=Release
它最终打破了这个例外:
FileNotFoundException: 无法加载文件或程序集 'Newtonsoft.Json,版本=7.0.0.0,文化=中性, PublicKeyToken=30ad4fe6b2a6aeed' 或其依赖项之一。这 系统找不到指定的文件。
我已经通过向 projectB 添加存根代码解决了这个问题:
string json = JsonConvert.SerializeObject(new Something());
有人能描述一下为什么它以前没有被复制吗?
注意。这些问题似乎没有回答问题或已过时或我错过了什么?
- MSBuild does not copy directly referenced dlls to bin folder
- msbuild not copying referenced assembly
- MSBuild doesn't copy references (DLL files) if using project dependencies in solution
- http://blog.alexyakunin.com/2009/09/making-msbuild-visual-studio-to.html
- Copying a DLL's dependencies in Visual Studio
【问题讨论】:
标签: msbuild