задача сценария nant build - PullRequest
       0

задача сценария nant build

0 голосов
/ 16 ноября 2011

Компиляция не удалась: c: \ Users \ miralp \ AppData \ Local \ Temp_qjans4v.0.cs (36,6): ошибка CS0012: тип «System.Xml.XmlDocument» определен в сборке, на которую нет ссылок. Необходимо добавить ссылку на сборку «System.Xml, версия = 1.0.3300.0, культура = нейтральная, 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>

1 Ответ

0 голосов
/ 08 декабря 2011

Попробуйте установить свойство nant.settings.currentframework следующим образом:

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