2011-11-16 217 views
0

編譯失敗: 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'。 我收到此錯誤,生成文件看起來像nant構建腳本任務

<?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> 

回答

0

嘗試將nant.settings.currentframework屬性是這樣的:

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