假设我们有以下项目结构:的NuGet和TFS 2013的构建时,SharePoint 2013包找不到装配
D:\workspace\Internet\Web
Web.sln
-> Project A
-> Project B
-> CommonSharePointProject X
-> uses and packages Newtonsoft.Json (for example)
D:\workspace\Common
CommonLibraries.sln
-> CommonSharePointProject X
-> uses and packages Newtonsoft.Json
-> Common Library Y
-> Common Library Z
我的问题是,常用的库。 软件包目录将在解决方案的目录下创建。 从Visual Studio中部署工作得很好。 CommonLibrary X在Web \ packages ...文件夹中引用了newtonsoft.json.dll。
但是,TFS Build期望newtonsoft.json.dll位于CommonLibraries \ packages中。 这是为什么?我该如何解决这个问题?
的错误如下: d:\ ws_build \ 1 \ CMP04 \ Buildname的\ src \共同文件\ SharePoint \东西\ MAIN \ CommonSharePointLibrary \包\ Package.package:以下文件无法找到: “d:\ ws_build \ 1 \ CMP04 \ BuildName的\ src \共同文件\ SharePoint \东西\ MAIN \包\ Newtonsoft.Json.6.0.1 \ LIB \ net45 \ Newtonsoft.Json.dll”。
...构建过程构建D:\ ws_build \ 1 \ CMP04 \ Buildname \ src \ Internet \ Web \ web.sln。 那么为什么它不在internet \ web \ packages而不是普通的... \ packages中寻找程序集?
SharePoint程序包使用相对路径引用第三方程序集:“.. \ packages \ Newtonsoft.Json.6.0.1 \ lib \ net45 \ Newtonsoft.Json.dll”。所以很显然,在TFSBuild中,相对路径指向与Visual Studio不同的地方。
另外假设我有另一个解决方案... CommonSharePointProject的引用Newtonsoft.Json指向哪里?由于项目在多个解决方案中使用,因此我无法在每个解决方案中对不同的包文件夹有不同的参考。只有一个.csproj文件。
D:\workspace\Intranet\OtherWeb
OtherWeb.sln
-> OtherProject A
-> OtherProject B
-> CommonSharePointProject X
-> uses and packages Newtonsoft.Json
我已经有这个地方。包还原和只有packages.config在我的源代码管理的包文件夹中。它对多个引用同一个.csproj没有帮助。 – lapsus
修复了编辑? ;) –
不幸的是 - 我在解决方案中添加了你提到的nuget包给每个启用nuget的项目。仍然没有运气。它似乎与SharePoint相关,因为它不能*封装*程序集。 (它编译得很好。) – lapsus