473,657 Members | 2,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\syst em32 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 programmaticall y. 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 1598
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 "OutputDirector y" 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*******@gmai l.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.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
2066
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 prompt. I have following issue: Issue: -------- MSBuild can invoke VCBuild internally. However it invokes VCBuild without
0
2022
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 vcbuild to perform the actual ..vcproj processing. I’ve been working on a tool that converts .vcproj files to msbuild formatted files so, with the appropriate C++ tasks (including cl and link tasks), a user could build his code on the command...
4
1830
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
6497
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 to external dll which have different paths on each machine. I am currently writing a build script and passing the specific path to the project file via the /p: switch of msbuild. My current build line is:
0
1453
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 fire off MSBuild in the PostBuildEvent of the project. I think it may work however I am having some command line issues with msbuild. The project I have is setup to build the DLL version of the app by default. In the project's PostBuildEvent I...
3
6832
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 avoid modifying the common.targets etc and the individual project .sln files and just do it within a solution proj. One method I've tried, is to create the .proj file from the .sln file using the msbuildemitsolution enviroment flag- base upon
1
3790
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? A lot of msbuild topics are about using msbuild.exe from the command line, but I need to know more about using Engine class members. What I want to know about is how to set properties for the BuildEngine object - the same properties that you...
0
873
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 Projects="ModelEvaluator\ModelEvaluator.csproj" Targets="Rebuild" > <Output ItemName="ModelAssemblies" TaskParameter="TargetOutputs"/> </MSBuild> <Copy SourceFiles="@(ModelAssemblies)" DestinationFolder="$(OutputFolder)\ModelEvaluator" />
7
2413
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/. I installed it but no new project type shows in my VS 2008.
0
8395
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8310
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8826
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7330
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6166
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.