msbuild

MSBuildShellExtension alternative?

Any alternatives out there to MSBuildShellExtension for running msbuild targets from the Explorer context menu? I'm looking for an alternative that is a bit more dynamic than MSBuildShellExtension -- e.g., instead of requiring manual configuration of build targets, reading available targets from the selected project file and listing thes...

How can I get current directory in msbuild script?

Hi, In my msbuild script I need to pass the full directory as a parameter. How can get it? Example: I am running the script from C:\dev, I want a relative path temp, so I am after C:\dev\temp Note: I don't know from which folder the script will be run. ...

MsBuild - Is it possible to isolate batch tasks, so one failing task doesn't skip the remaining tasks?

Let me start by example... I have an all.proj that looks similar to this: <ItemGroup> <ProjectsToBuild Include="..\Sites\*\*.csproj" /> </ItemGroup> <Target Name="DeployWebsites" DependsOnTargets="BuildMergedSolutions"> <AspNetCompiler PhysicalPath="%(ProjectsToBuild.RootDir)%(ProjectsToBuild.Directory)" TargetPath="%(Proj...

date format in msbuild script?

In my msbuild script I'm creating a zip file with year/month/day in the zip filename, but month and day are always written with no leading zero. Is there a way to add leading zero to my zip filename? <Time> <Output TaskParameter="Year" PropertyName="Year" /> <Output TaskParameter="Month" PropertyName="Month" /> <Output TaskParame...

Stop/Run windows service and building a solution

Hello, I'd like to have a script that stops a certain windows service,build or rebuild a solution and runs the service after the build process finished. Should I use Msbuild for this ? Or is there any other way ? ...

How do I import the msbuildcommunitytasks project from another msbuild project with a relative file path?

Please go easy I am new to msbuild and msbuildtasks! How can I set a property which represents a relative file path to a targets file which I want to import? I need relative references so it will work on all dev machines. But the target for import is trying to use the relative file path internally, which won't work as it is re-evaluat...

Item groups in msbuild

Hi, I have the following item group: <ItemGroup> <ReleaseFiles Include="MyApp\*.ashx"/> <ReleaseFiles Include="MyApp\*.config"/> <ReleaseFiles Include="MyApp\bin\*.dll"/> <ReleaseFiles Include="MyApp\bin\*.exe"/> <ReleaseFiles Include="MyApp\bin\*.pdb"/> <ReleaseFiles Include="MyApp\bin\*.config"/> </Item...

Writing a custom MSBuild task which contains arbitrary XML

Is this possible? And if so, could I retrieve the raw XML within the Execute method? <MyTask> <Arbitrary Xml="Here" /> </MyTask> I suspect the answer is no. ...

Problems using MsBuild using command line for Publish Click Once

Hi all, I have Windows application in csproj in my solution, and I want generate Publish using command line (bat, cmd). My script is (I put \r\n for better reading): SET MSBUILD="%SystemRoot%\Microsoft.NET\Framework\v3.5\MSBuild.exe" SET CARWIN="..\..\Security.CarWin.csproj" rem msbuild para publish %MSBUILD% /target:re...

Is it possible to sign an MSBuild file?

I've been running into the MSBuild SafeImports registry hack problem. We can't import a targets file without adding its path to the registry, otherwise Visual Studio pops up a security dialog asking for confirmation to load it. I saw a feature request about this filed at MS Connect in 2005. An MS person replied saying that they were pla...

Why doesn't this MSBuild script set the property the way I expect?

I'm trying to set a default value for an MSBuild property. Say I start with this: <Choose> <When Condition="..something.."> <PropertyGroup> ... <MySetting>true</MySetting> <PropertyGroup> </When> ... </Choose> If the condition is not true, then MySetting will be ''. So shouldn't this...

MSBuild - Writing Escape Characters to Files

I've got a very similar scenario to the one described in this post. It describes how to load the contents of a file that contains properties & items, making sure they're resolved as part of the process. I'm doing the same thing except writing the contents away to another text file (generally .ini file). In short I'd start by importing a...

MSBuild Refactoring - When Importing Shared Project, CallTarget doesn't work

Hello, I'm trying to refactor my MSBuild scripts and have imported a shared build definition by <Import Project="MSBuild.Passolo.targets" /> But when I call the custom target from the imported project <Target Name="AfterCompile"> ... <CallTarget Targets="MsBuildPassolo" /> ... it isn't executed. Thanks for your answers, Re...

Web Deployment Project AfterBuild path problems

I'm currently in the process of setting up a build server for a web project. I'm using Web Deployment Project to create a deployable package and I want to do some simple file administration (copy webDeploy.config -> web.config and delete .csproj files). My target looks as follows: <Target Name="AfterBuild"> <Delete Files="$(O...

Successful when executing VS 2005 project in Debug mode but failed in MinRelease mode

Hi, I developed a ClassLibrary in VC++ using VS 2005. Later I registered the dll, i got from building the project in MinRelease mode and when i tried to execute my application it failed. But the same application got executed successfully by registering the dll that i got from building the project in Debug mode What is the issue.? ...

tf.exe errors out with MSB3073: exited with code 1 while doing a label /recursive - diagnostic advice?

I'm working with a VS 2008 project file as the build script... when it gets to: TF.exe label Build_01_29_1$/RootDirectory/ChildDirectory . /recursive It errors out right away (no time out issues that I could fined) All I get is that is "exited with code 1" and error:MSB3073 and nothing else descriptive. So any advice on how to diagnosis...

Is there a way to fix the imported project error for Microsoft.CSharp.targets, other than changing the reserved property to $(MSBuildBinPath)?

So I am getting the error: The imported project "C:\Microsoft.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. When I run this command: %WINDIR%\Microsoft.NET\Framework\v2.0.50727\msbuild.exe MyProject.csproj /target:publish I found others stating that...

MSBuild file VS SLN and Project files

Hi all, I am just starting to look at MSBuild and get my head round the whole idea. I have setup a CI Server with Hudson and want to know how I "should" deal with build scripts and the sln / proj files. For example I have an existing solution that has 10 projects in it, (one being a website and another being the web deployment project...

Is there a possibility to use one property value inside another?

Hi, I would like to do something like this: <PropertyGroup> <propone>value</propone> </PropertyGroup> <PropertyGroup> <proptwo>$(propone)</proptwo> </PropertyGroup> Pass one property value as another. Is there a way to do this? How? ...

Use MSBuild to build Entity Framework Model without using the Project File?

I am in the process of build a script for a fairly big project. One of the projects require an Entity Framework Model to be compiled into a library. Due to the way the build server works, all builds are hand crafted to manage the various deployment scenarios without affecting the developers and the project files. Is there anyway to gene...