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

本文关键字:找不到 dnx 运行时 项目 Jenkins 构建 ASP NET 使用 | 更新日期: 2023-09-27 18:36:44

我在 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.

我尝试了需要安装 Dnx 运行时包中的方法。有关更多详细信息,请参阅输出窗口,但无法解决问题。

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

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

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

任何人都可以帮助了解如何解决问题吗?谢谢

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

我已经通过更改登录用户解决了这个问题。我右键单击"服务"中的"詹金斯",然后选择"属性"。然后在"登录标记"中,将此帐户设置为具有管理员权限的用户。

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