[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


How do i Call MSBuild.exe with nant to build a solution file for visual studio 2005

Posted on 2006-05-19
Medium Priority
Last Modified: 2012-05-05
I am using nant to do our automated builds and having a problem getting it to work with MSbuild and visual studio 2005 solutions. I am getting an error that says the return code was 1 when i tried this command below in my nant build file
<exec program="c:\windows\microsoft.net\framework\v2.0.50727\MSBuild.exe" commandline="/t:rebuild ${root}Web\mysite.solution.sln" />
does anybody have any ideas?
Question by:jasondole
  • 3
  • 2
LVL 27

Accepted Solution

Sammy Ageil earned 1500 total points
ID: 16721379
VS.Net doesnt store solution files in the root they are always in C:\Documents and Settings\"UserName"\My Documents\Visual Studio 2005\Projects
this post answers your question

LVL 19

Expert Comment

by:Melih SARICA
ID: 16721622
try to use the full path of ur solution file intead of root parameter

Author Comment

ID: 16734851
My program is still crapping out when i try to build, it says
MSBUILD: error MSB1009: Project file does not exist
switch: D:\devbuilds\Web\mysite.solution.sln
external program failed: c:\windows\microsoft.net\framework\v2.0.50727\MSBuild.exe (return code was 1)

Here is the command line i had based off the article you gave me:
<exec program="c:\windows\microsoft.net\framework\v2.0.50727\MSBuild.exe" verbose="true" failonerror="false" commandline="/t:rebuild d:\devbuilds\Web\mysite.solution.sln" />

Any ideas why this is?
Thanks again for all your help!
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 16737452
Ok, i used aspnet_compiler.exe and it seems to work with as a compiler but now i am getting errors dealing with missing assemblies, would using aspnet_compiler.exe cause these issues?
here is my call to the aspnet_compiler.exe call i have in nant.
<exec program="c:\windows\microsoft.net\framework\v2.0.50727\aspnet_compiler.exe"  commandline="-v /HBR -p d:\devbuilds\mysite\webapp -c errorstack" verbose="true" failonerror="false" workingdir="d:\devbuilds\mysite\"

my working directory is different becuase that is the directory where my refenernces are as the target directory is the main project, please let me know if you have any suggestions or comments, thanks for your help!
LVL 27

Expert Comment

by:Sammy Ageil
ID: 16737536
the compiler needs the project to have all assemblies.
check your classes for imports or using statements


Author Comment

ID: 16737686
all my classes have the correct assemblies, i migrated the solution file from vs2003 to vs2005 and it worked fine when i used to compile it in vs2003 but once i switched over to vs2005, i got this error so i think i am missing something in my compile statement but i am unsure, that is just a thought...

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month19 days, 10 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question