我的控制台的摘录
Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。版权所有。
C:\用户\miralp>cd\
C:>cd SVN
C:\SVN>..\Tools\nant-0.91-alpha2\bin\nant.exe -buildfile:C:\SVN\BestFareFinderGit\Source\Deploy\Functions.build
该系统找不到指定的路径。
C:\SVN>工具\nant-0.91-alpha2\bin\nant.exe -buildfile:C:\SVN\BestFareFinderGit\Source\Deploy\Functions.build
NAnt 0.91(内部版本 0.91.3881.0;alpha2;2010 年 8 月 17 日)
版权所有 (C) 2001-2010 Gerry Shaw
http://nant.sourceforge.net
构建文件:file:///C:/SVN/BestFareFinderGit/Source/Deploy/Functions.build
目标框架:Microsoft .NET Framework 4.0
构建失败
C:\SVN\BestFareFinderGit\Source\Deploy\Functions.build(4,3):
编译失败:
c:\Users\miralp\AppData\Local\Temp\izhn5siv.0.cs(36,6):错误 CS0012:类型“System.Xml.XmlDocument”在未引用的程序集中定义。您必须添加对程序集“System.
Xml,版本=1.0.3300.0,文化=中性,PublicKeyToken=b77a5c561934e089'。
//------------------------------------------------ ------------------------------
//
//此代码由工具生成。
//运行时版本:4.0.30319.239
//
//对该文件的更改可能会导致不正确的行为,并且会丢失
//重新生成代码。
//
//------------------------------------------------ ------------------------------
使用 NAnt.Core;
使用 NAnt.Core.Attributes;
使用系统;
使用 System.Collections;
使用 System.IO;
使用 System.Text;
[函数集(“ttl”,“ttl”)]
公共(public)类 nant84cd7051c5eb497da059d002e13b0448:NAnt.Core.FunctionSetBase {
[Function("expand_nant_properties_into_template")]
public string Expand_nant_properties_into_template(string templateFilepath, string propertiesFilepath, string applicationVersion)
{
const int INDENT_LEVEL = 0;
const string APPLICATION_VERSION = "applicationVersion";
//Get the contents of the template to be expanded
string template = new FileInfo(templateFilepath)
.OpenText()
.ReadToEnd();
//Create a new NAnt project with only the properties in the properties file
Project project = new Project(propertiesFilepath, Level.None, INDENT_LEVEL);
project.Properties.Add(APPLICATION_VERSION, applicationVersion);
//Load the properties into memory
project.Run();
return project.Properties.ExpandProperties(template, Location.UnknownLocation);
}
public nant84cd7051c5eb497da059d002e13b0448(NAnt.Core.Project project, NAnt.Core.PropertyDictionary propDict) :
base(project, propDict) {
}
}
总时间:1.4 秒。
C:\SVN>工具\nant\bin\nant.exe -buildfile:C:\SVN\BestFareFinderGit\Source\Deploy\Functions.build
NAnt 0.86(内部版本 0.86.2898.0;beta1;08/12/2007)
版权所有 (C) 2001-2007 Gerry Shaw
http://nant.sourceforge.net
构建文件:file:///C:/SVN/BestFareFinderGit/Source/Deploy/Functions.build
目标框架:Microsoft .NET Framework 3.5
[脚本] 扫描程序集“jp-pfatj”以获取扩展。
[脚本] 扫描程序集“rzb29ihl”以获取扩展。
构建成功
总时间:4.8 秒。
C:\SVN>..\Tools\nant-0.91-alpha2\bin\nant.exe -buildfile:C:\SVN\BestFareFinderGit\Source\Deploy\Functions.build
最佳答案
我假设您正在使用 msbuild nant 任务。
尝试设置 nant.settings.currentframework
像这样的属性(property):
<property name="nant.settings.currentframework" value="net-3.5" />
关于compiler-errors - nant 构建文件使用 nant 0.86 而不是 0.91 alpha 2 构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8155578/