473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

NANT, web projects and resource files

Hi,

I am trying to set up my C# web project to be compiled by NANT.
Everything compiles and works fine within the IDE. I have a created a
NANT build file which has a simple project tag, like this:

<?xml version="1.0" ?>
<project name="MyProject" default="build" basedir=".">
<description>The Hello World of build files.</description>
<property name="debug" value="true"/>
<property name="bin_directory" value="bin"/>

<target name="clean" description="remove all generated files">
<delete dir="${bin_directory}" failonerror="true"
verbose="true"/>
</target>

<target name="build" description="compiles the source code"
depends="clean">
<solution configuration="release">
<projects>
<includes name="MyProject.csproj" />
</projects>
</solution>
</target>

</project>

It gives me some errors on the building of resource files. Some work,
and some don't. I have been able to work around some files by just
deleting whatever info was shown in the resource editor. The error are
stuff like:

c:\MyProject\MyPage.aspx.resx
error: Invalid ResX input

I have not changed any of the resource files, they are the ones VS
generates. Does NANT use a different compiler then the IDE, seems so?

Does anyone have any idea what might be wrong.

Thanks!!!
Dave
Nov 17 '05 #1
2 1162
it uses the same compilers (vbc.exe and csc.exe) as the ide. look at your
nant config, to see which framework (1.0 or 1.1) nant is building with.
"HaukiDog" <Ha******@hotmail.com> wrote in message
news:6d**************************@posting.google.c om...
Hi,

I am trying to set up my C# web project to be compiled by NANT.
Everything compiles and works fine within the IDE. I have a created a
NANT build file which has a simple project tag, like this:

<?xml version="1.0" ?>
<project name="MyProject" default="build" basedir=".">
<description>The Hello World of build files.</description>
<property name="debug" value="true"/>
<property name="bin_directory" value="bin"/>

<target name="clean" description="remove all generated files">
<delete dir="${bin_directory}" failonerror="true"
verbose="true"/>
</target>

<target name="build" description="compiles the source code"
depends="clean">
<solution configuration="release">
<projects>
<includes name="MyProject.csproj" />
</projects>
</solution>
</target>

</project>

It gives me some errors on the building of resource files. Some work,
and some don't. I have been able to work around some files by just
deleting whatever info was shown in the resource editor. The error are
stuff like:

c:\MyProject\MyPage.aspx.resx
error: Invalid ResX input

I have not changed any of the resource files, they are the ones VS
generates. Does NANT use a different compiler then the IDE, seems so?

Does anyone have any idea what might be wrong.

Thanks!!!
Dave

Nov 17 '05 #2
One thing you might want to try is to download the NAntContrib add-on's from
nantcontrib.sourceforge.net.

There's a task included called "SLiNgshot" (something like that) that will
parse your Solution file and create a <solution name>.build file for you
when you execute the task. I've used this as a kind of jumpstart for
creating a new build script.

<?xml version="1.0"?>
<project name="SlingShot Example" default="build" basedir=".">
<description>SlingShot Example</description>

<property name="solutionName" value="HelloWorld" readonly="true"/>

<target name="BuildSolution">
<!-- Parse the specified Solution file -->
<!-- Create a Nant build file from that file. -->
<slingshot solution="${solutionName}.sln" format="nant"
output="${solutionName}.build">
<parameters>
<option name="build.basedir" value="..\bin"/>
</parameters>
</slingshot> -->
<!-- Execute the generated build file. -->
<nant buildfile="${solutionName}.build"/>
</target>

</project>

This script will create "HelloWorld.build" based on your solution
"HelloWorld.sln". From there you can examine the generate build script and
alter it as you see fit. If you want to alter the generated script I
recommend removing or commenting out the slingshot task, because the
generated .build file will be overwritten every time the script is executed.

Hope this is helpful!

Michael Hall
mh***@just3ws.com
Just3Ws, Inc.

"HaukiDog" <Ha******@hotmail.com> wrote in message
news:6d**************************@posting.google.c om...
Hi,

I am trying to set up my C# web project to be compiled by NANT.
Everything compiles and works fine within the IDE. I have a created a
NANT build file which has a simple project tag, like this:

<?xml version="1.0" ?>
<project name="MyProject" default="build" basedir=".">
<description>The Hello World of build files.</description>
<property name="debug" value="true"/>
<property name="bin_directory" value="bin"/>

<target name="clean" description="remove all generated files">
<delete dir="${bin_directory}" failonerror="true"
verbose="true"/>
</target>

<target name="build" description="compiles the source code"
depends="clean">
<solution configuration="release">
<projects>
<includes name="MyProject.csproj" />
</projects>
</solution>
</target>

</project>

It gives me some errors on the building of resource files. Some work,
and some don't. I have been able to work around some files by just
deleting whatever info was shown in the resource editor. The error are
stuff like:

c:\MyProject\MyPage.aspx.resx
error: Invalid ResX input

I have not changed any of the resource files, they are the ones VS
generates. Does NANT use a different compiler then the IDE, seems so?

Does anyone have any idea what might be wrong.

Thanks!!!
Dave

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Nigel Currie | last post by:
Hi all, I'm having a problem with <nant> tasks to build sub-projects into an overall solution. I have the following directory structure: JobManagerSolution |_ | JobManager |_...
2
by: HaukiDog | last post by:
Hi, I am trying to set up my C# web project to be compiled by NANT. Everything compiles and works fine within the IDE. I have a created a NANT build file which has a simple project tag, like...
1
by: urban.john | last post by:
Here are my steps: create resource files from resx files: <echo message="CREATING RESOURCE FILES FROM RESGEN EN" /> <resgen todir="product\resources_en" verbose="true"> <resources> <include...
1
by: Bit byte | last post by:
I am a NANT newbie. I would like to use NAnt to automate my build processes - but have come unstuck early on in the process. I have several projects under a /src directory. There is some...
3
by: Me | last post by:
I have a simple solution file which I am looking to build using Nant However this is written in .net 2.0 and when I try building this .net 2.0, I get an error message saying "Microsoft Visual...
2
by: Brett Romero | last post by:
I am compiling a winform app using nant. I first compile via VS.NET, which generates *.resource files in obj\debug. Then I use the <resources> tag in the Nant script to complete a build via Nant....
0
by: Brett Romero | last post by:
I can build a winexe using Nant without problems. If I add a Resources.resx file with images in it and reference those image on a form, I can't build correctly. The build success but the program...
1
by: Spam Catcher | last post by:
Hello Everyone, I just started using nant in conjunction with cruisecontrol.net. The <solutiontag has been great in helping us compile VS.NET 2003 projects without need to write a nant build...
0
by: james.mcdonagh | last post by:
Hi I am a newbie using nAnt for .net 2.0. As such I have not come across this bug before, and I would be happy of any help that you may be able to provide. In order to help I have included the...
1
by: jamesmcdonagh | last post by:
Hi newbie using nAnt for .net 2.0. I would be happy of any help that you may be able to provide. The weird thing is that VS.net builds without a problem. And the intellisense within the object...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.