Thomas,
a couple of things. Firstly you shouldn't be including the .sln file in the includes list for the csc task. It will just be ignored anyway. If you really want to build the solution then use the solution task.


As for the resource loading issue- the problem is that you aren't compiling the attached resources. If you look in your project directory (${TESTNANTWINAPP}) you'll see a Form1.resx file. You need to add a <resources> tag to your csc task to compile this in. VS.net does the same thing behind the scenes.
so:


<csc target="winexe"
output="${RELEASEFOLDER}\${TESTNANTWINAPP.EXE}" debug="false">
<sources> <includes name="${TESTNANTWINAPP}\AssemblyInfo.cs"/> <includes name="${TESTNANTWINAPP}\Form1.cs" />
</sources> <resources>
<includes name="Form1.resx"/>
</resources>


...

If you still have problems could you please post the full text of any error output.

Ian


Thomas A. Brandle wrote:

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






--
Ian MacLean, Developer, ActiveState, a division of Sophos
http://www.ActiveState.com




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to