msbuild-4.0

How to get all the metadata keys for any ItemGroup item?

[亡魂溺海] 提交于 2019-11-27 21:23:57
问题 Is there a way to get all the metadata keys associated with a given item? I want to do something like the following. Given: <ItemGroup> <MyItems Include="item1"> <key1>val1</key1> <key2>val2</key2> <key3>val3</key3> </MyItems> <MyItems Include="item2"> <key4>val4</key4> </MyItems> </ItemGroup> Be able to determine that item1 has metadata available for key1, key2, and key3, and that item2 has metadata available for key4, without knowing what the names of those keys actually are. In effect, I'm

error MSB4166: Child node exited prematurely. Shutting down

旧城冷巷雨未停 提交于 2019-11-27 20:52:26
问题 Sometimes my build fail with this error. 0>MSBUILD : error MSB4166: Child node "3" exited prematurely. Shutting down. It seems to be completely random and I've not been able to reproduce it at will. I'm running VS2010 Win7 x64 MSBuild 4.0 but this problem seems to be platform and OS independent. I'm building solutions in parallel (/m switch + BuildInParallel=True) and I don't want to disable this feature because I'm compiling application containing 800+ projects . Any idea how to solve it?

Copy bin files on to Physical file location on Post Build event in VS2010

て烟熏妆下的殇ゞ 提交于 2019-11-27 18:22:16
I want to copy my dll generated in bin folder to a file location on Post Build Event in vs2010. Can some one help me on that. Thanks You want to add something like: xcopy /Q /Y "$(TargetPath)" "C:\path\to\somewhere\" to you post-build event on the Build Events tab in the project properties page. The /Y will stop it from prompting you to confirm an overwrite. If you also need to copy the .pdb file, you will need something like this: xcopy /Q /Y "$(TargetDir)$(TargetName).*" "C:\path\to\somewhere\" You can see more substitution tokens (the $XXX values) by clicking the Edit Post-build... button

How to debug a project file in MSBuild 12.0 / VS2013?

倾然丶 夕夏残阳落幕 提交于 2019-11-27 18:02:46
问题 Tracing a project was easy in MSBuild 4.0 / VS2010, all you had to do was set registry key which enabled an msbuild /debug command line option. The debugger would launch and break at the start of the project file. MSBuild 12 introduces a new environment variable for this. At the command prompt, set MSBUILDDEBUGONSTART=1 and then run MSBuild (no command line switch). This launches the debugger, but does no break . The project just runs to completion with VS open. Am I missing a setting? Or has

Build MSBuild target without dependencies

瘦欲@ 提交于 2019-11-27 04:28:51
问题 Is there any way I can tell MSBuild 4.0 to build a target, but ignore any dependencies? I just want to build that target itself, nothing else. 回答1: I would like to reiterate @EMP's solution (and I can't vote him up due to my puny reputation). The correct way to avoid MSBuild's default behavior of rebuilding all the dependencies listed in the project file is to set the BuildProjectReferences property to false. In his answer he invokes MSBuild from within an MSBuild script; here's an example

Copy bin files on to Physical file location on Post Build event in VS2010

安稳与你 提交于 2019-11-26 22:40:11
问题 I want to copy my dll generated in bin folder to a file location on Post Build Event in vs2010. Can some one help me on that. Thanks 回答1: You want to add something like: xcopy /Q /Y "$(TargetPath)" "C:\path\to\somewhere\" to you post-build event on the Build Events tab in the project properties page. The /Y will stop it from prompting you to confirm an overwrite. If you also need to copy the .pdb file, you will need something like this: xcopy /Q /Y "$(TargetDir)$(TargetName).*" "C:\path\to

Using WriteCodeFragment MSBuild Task

旧城冷巷雨未停 提交于 2019-11-26 22:11:36
问题 I am trying to use WriteCodeFragment MSBuild task to create AssemblyVersion attribute. I'm having a a problem creating a property group to correctly pass the ITaskItem array required for processing. Can someone help with an example. 回答1: This creates a file called BuildVersion.cs with an AssemblyVersion attribute of 123.123.123.123 . If OutputFile is removed then a randomly generated file name will be used instead. The Compile item name automatically adds the item to the Compile items