我正在使用 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
最佳答案
它需要“框架”部分中的 .net 3.5 条目。
确保章节中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/