[置顶] VS2016 发布项目提示 CS0006 C# Metadata file 'xxxxxxx.dll' could not be found
posted @ 2016-11-08 16:08 oceanho 阅读(17000) 评论(0) 推荐(1) 编辑
posted @ 2016-11-08 16:08 oceanho 阅读(17000) 评论(0) 推荐(1) 编辑
posted @ 2016-05-09 10:13 oceanho 阅读(367) 评论(0) 推荐(0) 编辑
posted @ 2016-03-19 23:07 oceanho 阅读(3327) 评论(0) 推荐(0) 编辑
posted @ 2016-02-27 22:16 oceanho 阅读(900) 评论(0) 推荐(0) 编辑
posted @ 2015-12-10 23:38 oceanho 阅读(242) 评论(0) 推荐(0) 编辑
posted @ 2015-11-30 10:32 oceanho 阅读(225) 评论(0) 推荐(0) 编辑
posted @ 2015-11-12 09:34 oceanho 阅读(366) 评论(0) 推荐(0) 编辑
posted @ 2015-10-30 16:30 oceanho 阅读(742) 评论(2) 推荐(1) 编辑
posted @ 2015-10-23 10:19 oceanho 阅读(4171) 评论(0) 推荐(0) 编辑
posted @ 2015-10-15 18:26 oceanho 阅读(3392) 评论(0) 推荐(0) 编辑
posted @ 2015-10-12 16:31 oceanho 阅读(6176) 评论(12) 推荐(14) 编辑
posted @ 2015-10-09 09:18 oceanho 阅读(2921) 评论(0) 推荐(0) 编辑
posted @ 2015-09-14 10:48 oceanho 阅读(7094) 评论(0) 推荐(0) 编辑
posted @ 2015-07-16 16:22 oceanho 阅读(2512) 评论(0) 推荐(0) 编辑
posted @ 2015-05-23 21:50 oceanho 阅读(996) 评论(0) 推荐(1) 编辑
posted @ 2014-12-17 15:39 oceanho 阅读(1217) 评论(0) 推荐(0) 编辑
最近遇到一个情况,IDE 是 VS2015 Update3 ,新建一个library项目(暂时叫做 mytests),然后用 nuget 安装了一个 Shouldly 包
在 VS 上一切正常,可以跑起来。
当放到 Jenkins 上,死活不还原。查看Jenkins的输出日志,没有找到任何 mytests 自动还原的信息
最后找了一个其它能自动还原的项目一比较。发现在.csproj文件中缺少
1 | <Import Project= "$(SolutionDir)\.nuget\NuGet.targets" Condition= "Exists('$(SolutionDir)\.nuget\NuGet.targets')" /> |
最后手动修改了 mytests.csproj 文件,在
1 | <Import Project= "$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
下面加上
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
然后在jenkins上,此项目的 nuget 就自动还原了。
一定要注意 Import 的 Project 属性,是当前项目文件(.csproj)相对于nuget.targets的路径。
我的单元测试项目是在 test 目录下,源码在 src 下 ,src 和 test 是兄弟目录,.nuget目录(文件 nuget.exe / nuget.target / nuget.config)也在src目录下
所以,我在mytest.csproj文件开头的PropertyGroup属性中,添加了下面这段Property。这个 SolutionDir 在 上面
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" /> 中用到。
我的SolutionDir值指向的地址是..\..\src\,这样就把目录指向src了,路径就对了。(当前目录是.csproj文件所在目录。上级是 test ,再上级是 test和src的父目录,所以 ..\..\src 就到src下面了)
1 | <SolutionDir Condition= "$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'" >..\..\src\</SolutionDir> |
posted @ 2017-01-19 16:34 oceanho 阅读(1376) 评论(0) 推荐(0) 编辑
posted @ 2016-05-18 16:47 oceanho 阅读(947) 评论(0) 推荐(0) 编辑
posted @ 2016-05-18 13:28 oceanho 阅读(1617) 评论(0) 推荐(0) 编辑
posted @ 2016-05-18 12:02 oceanho 阅读(10153) 评论(0) 推荐(0) 编辑
posted @ 2016-04-19 09:55 oceanho 阅读(526) 评论(0) 推荐(0) 编辑
posted @ 2016-03-29 15:39 oceanho 阅读(356) 评论(0) 推荐(0) 编辑