使用Jenkins构建ASP.NET 5项目,找不到dnx运行时

时间:2016-03-01 01:26:51

标签: c# asp.net jenkins

我在Jenkins中构建ASP.NET 5时遇到问题。错误消息如下:

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 1/03/2016 12:14:47 PM.
Project "C:\Program Files (x86)\Jenkins\jobs\TestWebsite\workspace\TestWebsite.sln" on node 1 (Rebuild target(s)).
ValidateSolutionConfiguration:
Building solution configuration "Release|Any CPU".
The target "BeforeGenerateProjectPriFile" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (186,61)" does not exist in the project, and will be ignored.
Project "C:\Program Files (x86)\Jenkins\jobs\TestWebsite\workspace\TestWebsite.sln" (1) is building "C:\Program Files (x86)\Jenkins\jobs\TestWebsite\workspace\src\TestWebsite\TestWebsite.xproj" (2) on node 1 (Rebuild target(s)).
GetRuntimeToolingPathTarget:
Cannot find DNX runtime dnx-clr-win-x86.1.0.0-rc1-update1 in the folder: C:\Windows\system32\config\systemprofile\.dnx\runtimes
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DNX\Microsoft.DNX.targets(126,5): error : The Dnx Runtime package needs to be installed. See output window for more details. [C:\Program Files (x86)\Jenkins\jobs\TestWebsite\workspace\src\TestWebsite\TestWebsite.xproj]
Done Building Project "C:\Program Files (x86)\Jenkins\jobs\TestWebsite\workspace\src\TestWebsite\TestWebsite.xproj" (Rebuild target(s)) -- FAILED.
Done Building Project "C:\Program Files (x86)\Jenkins\jobs\TestWebsite\workspace\TestWebsite.sln" (Rebuild target(s)) -- FAILED.

我尝试了The Dnx Runtime package needs to be installed. See output window for more details中的方法,但无法解决问题。

C:\Windows\System32\config\systemprofile>dnvm list

Active Version           Runtime Architecture OperatingSystem Alias
------ -------           ------- ------------ --------------- -----
   1.0.0-rc1-update1 clr     x64          win
  *1.0.0-rc1-update1 clr     x86          win             default
   1.0.0-rc1-update1 coreclr x64          win
   1.0.0-rc1-update1 coreclr x86          win

我在安装Visual Studio 2015的同一台机器上安装Jenkins。我尝试了一个控制台应用程序,它可以在Jenkins中编译和测试。

我发现Dnx运行时位于C:\ Users \ .dnx \ runtims \文件夹下,而不是C:\ Windows \ system32 \ config \ systemprofile.dnx \ runtimes。实际上,文件夹systemprofile中没有.dnx \ runtimes。我试图删除C:\ Users \ .dnx \ runtims \中的所有运行,然后运行dnvm update以重新安装运行时。然而,没有什么特别的事。所有运行时都再次安装到C:\ Users \ .dnx \ runtims \。有没有办法将运行时路径指向C:\ Users \ .dnx \ runtims \?

任何人都可以帮忙看看如何解决问题?谢谢

2 个答案:

答案 0 :(得分:0)

我通过更改登录用户解决了这个问题。我右键单击服务中的Jenkins并选择Property。然后在“登录”标记中,将此帐户设置为具有管理员权限的用户。

答案 1 :(得分:0)

只是增加了Ben的答案,我遇到了同样的问题,并通过更改jenkins服务的登录帐户尝试了Ben的解决方案,只有在我重新启动jenkins机器之后才能运行。我不知道为什么,但仍留下我的评论,以防任何人遇到同样的问题,这可能会节省他/她的时间。