.net - 安装 ASP.NET 2.0 SDK 后,NAnt 在 Windows Server 2008 上构建失败

标签 .net nant teamcity

我正在使用 TeamCity 来管理我的一个项目,但它似乎与 Windows Server 2008 上的 Nant 配合不佳。我该如何解决此问题?

安装 ASP.NET 2.0 Framework SDK 之前:

[10:21:07]: BUILD FAILED
[10:21:07]: Failed to initialize the 'Microsoft .NET Framework 2.0' (net-2.0) target framework.
[10:21:07]:     Property evaluation failed.
[10:21:07]: Expression: ${path::combine(sdkInstallRoot, 'bin')}
[10:21:07]:                             ^^^^^^^^^^^^^^
[10:21:07]:         Property 'sdkInstallRoot' has not been set.

之后:

[11:48:16]: Target framework: Microsoft .NET Framework 2.0
[11:48:16]: Target(s) specified: test 
[11:48:16]:  [property] Target framework changed to "Microsoft .NET Framework 3.5".
[11:48:16]: BUILD FAILED
[11:48:16]: INTERNAL ERROR
[11:48:16]: System.NullReferenceException: Object reference not set to an instance of an object.
[11:48:16]:    at NAnt.Core.FrameworkInfo.get_Version()
[11:48:16]:    at NAnt.Core.Project.UpdateTargetFrameworkProperties()
[11:48:16]:    at NAnt.Core.Tasks.PropertyTask.ExecuteTask()
[11:48:16]:    at NAnt.Core.Task.Execute()
[11:48:16]:    at NAnt.Core.Project.InitializeProjectDocument(XmlDocument doc)
[11:48:16]:    at NAnt.Core.Project.Execute()
[11:48:16]:    at NAnt.Core.Project.Run()
[11:48:16]: Please send bug report to <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4e202f203a632a2b382b22213e2b3c3d0e22273d3a3d603d213b3c2d2b28213c292b60202b3a" rel="noreferrer noopener nofollow">[email protected]</a>.
[11:48:16]: Total time: 0.1 seconds.
[11:48:16]: Process exited with code 1
[11:48:16]: Build finished

最佳答案

  1. 它需要“框架”部分中的 .net 3.5 条目。

  2. 确保章节中3.5版本的Sdkinstallroot如下,这就是这个问题的根本原因 -
    <readregistry property="sdkInstallRoot" key="SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFx40Tools\InstallationFolder" hive="LocalMachine" failonerror="false" />

希望这有帮助!

关于.net - 安装 ASP.NET 2.0 SDK 后,NAnt 在 Windows Server 2008 上构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/635224/

相关文章:

c# - 如何配置 Simple Injector 以在 ASP.NET MVC 中运行后台线程

c# - 从类外部初始化公共(public)类成员数组

mysql - 如何在nant脚本中处理表数据?

java - Maven系统属性优先级

ios - TeamCity 8 xcode 5 代理代码签名错误

c++ - 如何将自定义 Artifactory 从 TeamCity 发布到 Artifactory?

.net - 在 MSChart 控件中反转 Y 轴

.net - 如何在 .NET 应用程序中嵌入 IronPython

windows-authentication - 如何让 Vault 使用 NAnt 的 Windows 身份验证?