I am a new NAat user, and I am having some trouble building a windows application. I am using the last stable build 0.84

 

 

<project>

<target name="MakeDirs">

            <mkdir dir="${BIN}" />

            <mkdir dir="${BIN}\${RELEASE}" />

      </target>  

      <target name="build_WINAPP" depends="MakeDirs">

            <csc target="winexe" output="${RELEASEFOLDER}\${TESTNANTWINAPP.EXE}" debug="false">                           

                  <sources>

                        <include name="${TESTNANTWINAPP}\TestNAntWinøpp.sln" /> <!—-  or csproj on niether -->

                        <includes name="${TESTNANTWINAPP}\AssemblyInfo.cs" />                  

                        <includes name="${TESTNANTWINAPP}\Form1.cs" />                   

                  </sources>                               

            </csc>               

    </target>                                    

                           

  </project>

 

I didn’t include the properties. NAnt builds the app correctly only if I modify the Form.InitializeComponent method and replace the line

this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));

 

with

this.Icon = new Icon(@"C:\Code\TestSWDBuildScripts\TestNAntWinApp\TestNAntWinApp\App.ico");

 

the App.ico is not the default icon, but the company icon.

 

It doesn’t matter if I include the solution file or the project file or I don’t include either. It builds all other apps I have tried just fine, console, dll, even win services. When I try to run the app the VS debugger fires off and it cries about the resource file. I have tried everything I can think of to include the resource file, but then the build fails. I have been reading a few of the threads, but nothing so far has worked. I can’t easily include the above line into all forms. There are just to many and when the gui is edited, VS rewrites the InitializeComponent method.

 

If anyone can point me in the right direction, I would really appreciated it.

Thanks

Reply via email to