473,385 Members | 1,396 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,385 software developers and data experts.

MSBuild question

I have a general question about MSBuild (which I know little about so far)
and I hope this is the right newsgroup. I can read the reference
documentation about MSBuild, but it's not really telling me what I want to
know. Perhaps someone can point me in the right direction.

We have several projects, mostly C++, that we develop with Visual Studio
2005. I would like to automate this process. All of the targets, executables
and DLLs, need to be built and then copied along with other files to a final
directory somewhere to form the final product. Ok, that much seems easy
enough. I presume I can call MSBuild from some script language or even C# to
automate things. I don't think I need to manually create an MSBuild project
file because we work from within the VS2005 IDE just fine.

But in order to copy the target file after it's been built, I need to know
where it is. How can I know from the automation point-of-view? Often, when
we work and debug from the VS2005 IDE we'll set the output directory to
C:\Windows\system32 for convenience because that's where the file installs
to in the final product, so the compile/debug cycle is easier. Or we may
not. Or we may change the output filename.

So from the automation/build point-of-view, I need to find the output file
for any given project programmatically. So far, the only way I can see to do
this is to parse the .proj file. But even then it's not so straightforward.
Sometimes that info isn't in the .proj file at all if you've left the linker
output file setting to the default. Or, another alternative would be to
override just the linker output file location when building from MSBuild. Is
that possible?

I get the feeling I may going about this from the wrong direction. Am I?
What's the best way to approach this?

Thanks for any comments.


Feb 10 '06 #1
2 1581
Hi MinorGuy,

Off hand, I don't know the answer to your questions. However, I have
compiled a list of links to MSBuild resources that I found while
researching for my own projects, that may help you out:

http://www.tod1d.net/blog/2005/12/ms...resources.html

Hope this helps.

--
Tod Birdsall, MCSD for .Net
software blog: http://tod1d.net

Feb 11 '06 #2
Thanks Tod! Great reference and I'll definitely use it.

I'm thinking that I need to use VCBuild.exe directly instead of MSBuild.
MSBuild seems good if you want to control your build by manually editing a
text file like you would a makefile. But in our case, we usually set all
project settings from within VS2005. So we don't need to deal with settings
at build time. The only thing I need to do is invoke the build process and
then copy the output file somewhere.

I think I can parse the C++ project file to get the output file name and
location. I don't see any documentation to confirm this, so I'm starting out
by assumption. If the "Outputfile" linker property is not set, then I assume
the default location is defined by the "OutputDirectory" property and
default name is the same as the project name. I'm going to try that and see
how it goes.

Unfortunately, I may have to change all this in the future since C++ will
become directly buildable under MSBuild in the next VS version. The .vcproj
format will most likely change.

<tb*******@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi MinorGuy,

Off hand, I don't know the answer to your questions. However, I have
compiled a list of links to MSBuild resources that I found while
researching for my own projects, that may help you out:

http://www.tod1d.net/blog/2005/12/ms...resources.html

Hope this helps.

--
Tod Birdsall, MCSD for .Net
software blog: http://tod1d.net

Feb 13 '06 #3

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

Similar topics

1
by: Uma Abhyankar | last post by:
Hello All, I was facing an issue with VCBuild on Beta1. Today after shifting to .NET Beta2, it looks like the issue is still not resolved :-( I have to invoke VCBuild through MSBuild on command...
0
by: Craig Lichtenstein | last post by:
As I’ve been reading about msbuild, I’ve noticed articles that mention msbuild’s incapability to natively read .vcproj files. In short, executing msbuild blah.vcproj causes msbuild to invoke...
4
by: BuddyWork | last post by:
Hello, Does anyone know if the csproj extension is been used under Whidbey or if it uses MSBuild (proj) extension?
1
by: ritesh.noronha | last post by:
Hi Group, I have a question regarding the commandline options of msbuild. I am currently using msbuild to build projects using the existing solution files. These solution files have references...
0
by: ME | last post by:
I have a need to generate both the DLL version of my application and an EXE version. I would like to build both of them with a single call "build". One of the ideas I have come up with is to...
3
by: Danny | last post by:
Hi I trying to master msBuild but have a problem. I have a solution that I wish to build using msbuild but want to override BeforeBuild/AfterBuild targets for each of the projects. I trying to...
1
by: Divided Sky | last post by:
Is there an msbuild-specific discussion group? Also, is there an msbee discussion group that is active? Is there a good resource for info about using Microsoft.Build.BuildEngine.Engine class? ...
0
by: Satish | last post by:
I'm rather new to MSBuild. I'm trying to build a project and copy the build result to a deploy folder. Here is the target I created for this. <Target Name="BuildModelEvaluator" > <MSBuild...
7
by: shapper | last post by:
Hello, I am working on an ASP.MET MVC Web Application with NET 3.5 in VS 2008. I need to run some extra tasks on this project build so I download MSBuild from http://msbuildtasks.tigris.org/....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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...

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.