【问题标题】:nant build script tasknant 构建脚本任务
【发布时间】:2011-11-16 04:05:11
【问题描述】:

编译失败: c:\Users\miralp\AppData\Local\Temp_qjans4v.0.cs(36,6):错误 CS0012:类型“System.Xml.XmlDocument”在未引用的程序集中定义。您必须添加对程序集“System.Xml,Version=1.0.3300.0,Culture=neutral,PublicKeyToken=b77a5c561934e089”的引用。 我收到这个错误,构建文件看起来像

<?xml version="1.0" encoding="utf-8"?>
<project name="Ttl.Deploy.Refunds.Functions.build" basedir="." xmlns="http://nant.sf.net/release/0.85/nant.xsd">

    <script language="C#" prefix="ttl" >
        <code>
            <references>
                    <include name="System.Xml.dll" />
                    <include name="System.dll" />       
                    <include name="System.IO.dll" />        
                    <include name="NAnt.Core.dll" />

                </references>
                <imports>
                    <import namespace="System.Xml" />
                    <import namespace="System" />
                    <import namespace="System.IO" />
                    <import namespace="NAnt.Core" />

                </imports>
            <![CDATA[
                [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);
                }
            ]]>
        </code>
    </script>


</project>

【问题讨论】:

    标签: nant


    【解决方案1】:

    尝试像这样设置nant.settings.currentframework 属性:

    <property name="nant.settings.currentframework" value="net-3.5" />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-17
      • 1970-01-01
      • 1970-01-01
      • 2012-08-21
      • 1970-01-01
      相关资源
      最近更新 更多