msbuild-4.0

How to append conditional compilation symbols in project properties with MSBuild?

夙愿已清 提交于 2019-12-03 17:03:02
问题 I am stuck in a situation where I have an MSBuild script that needs to read the conditional compilation symbols set in project's build property. I have the following code in my MSBuild script file <PropertyGroup> <DefineConstants>$(DefineConstants);INTER</DefineConstants> </PropertyGroup> <Target Name="Compile"> <Message Text="$(DefineConstants)"/> <MSBuild Projects="CustomAssemblyInfo.csproj" Targets="Rebuild" Properties="DefineConstants=$(DefineConstants)" /> </Target> I was assuming that

VS2010 rebuilds C++ project because of modified irrelevant files

妖精的绣舞 提交于 2019-12-03 13:09:53
As all of us already know VS2010 has got an major upgrade of its build system, which is based on MSBuild. According to MS representatives (see comments in Visual Studio 2010 always rebuild project after hibernation/restart of computer ) MSBuild now injects itself into other tools (like C++ compilers, linkers, etc.) to find out the dependencies of a target. One of the drawbacks of such approach is that now your project may be forcedly rebuilt because of modifications in irrelevant files :( In my case it is C:\PROGRAMDATA\NVIDIA CORPORATION\DRS\NVDRSDB0.BIN , which is periodically changed by

Building C++ project on a PC with Windows SDK 7.1 but without VS2010

十年热恋 提交于 2019-12-03 09:36:36
问题 I have a C++ project (some sort of a console 32-bit appplication) developed in VS2010, which builds just fine on my PC (Windows 7 32-bit). My PC has Microsoft SDK 7.0A installed, which I think comes bundled with VS2010. I try to build the project on a build server, which doesn't have any Visual Studio installed - only Microsoft SDK 7.1 is present there. I try to build the project with the help of msbuild (this will eventually become the task for TeamCity's runner), and on the build server I

How to append conditional compilation symbols in project properties with MSBuild?

不想你离开。 提交于 2019-12-03 06:58:56
I am stuck in a situation where I have an MSBuild script that needs to read the conditional compilation symbols set in project's build property. I have the following code in my MSBuild script file <PropertyGroup> <DefineConstants>$(DefineConstants);INTER</DefineConstants> </PropertyGroup> <Target Name="Compile"> <Message Text="$(DefineConstants)"/> <MSBuild Projects="CustomAssemblyInfo.csproj" Targets="Rebuild" Properties="DefineConstants=$(DefineConstants)" /> </Target> I was assuming that the $(DefineConstants); will contain the value of conditional compilation symbols that are set and I can

How do I restore a property sheet to its default value?

瘦欲@ 提交于 2019-12-03 03:05:15
Let's say I carry out the following steps immediately after first installing and opening Microsoft Visual Studio 2010: File -> New -> Project -> Win32 Console App -> Finish . Go to the Property Manager pane -> Expand Debug | Win32 -> Right click Microsoft.Cpp.Win32.user -> Select Properties . Wildly change settings in a clueless manner, and generally act like a fool. Click Apply , save the project, and close Visual Studio. How do I restore the Microsoft.Cpp.Win32.user property sheet to its default, "factory" settings? I'm not sure if this is the official way, but it does work... The default

Building C++ project on a PC with Windows SDK 7.1 but without VS2010

ⅰ亾dé卋堺 提交于 2019-12-02 23:54:07
I have a C++ project (some sort of a console 32-bit appplication) developed in VS2010, which builds just fine on my PC (Windows 7 32-bit). My PC has Microsoft SDK 7.0A installed, which I think comes bundled with VS2010. I try to build the project on a build server, which doesn't have any Visual Studio installed - only Microsoft SDK 7.1 is present there. I try to build the project with the help of msbuild (this will eventually become the task for TeamCity's runner), and on the build server I get following errors (the detailed log is provided): Project "E:\win\core.sln" on node 1 (default

Include referenced project's .config file

南笙酒味 提交于 2019-12-02 18:08:32
Rather than excluding a file from the referenced output of an assembly , I want to add one! I have a console application project (BuildTest1) that references a second class library project (ClassLibrary1). The Visual Studio solution looks like this: I have a class library project that has an app.config. I want this .config file copied to the referring project's output, just like the .dll and .pdb files are. The config file for the class library is copied to the class library output directory as 'ClassLibrary1.dll.config' I've tried adding this to the .exe project's .csproj file but it doesn't

Build doesn't work from VisualStudio, but is ok from msbuild

允我心安 提交于 2019-12-02 16:43:04
问题 From a brand new console application template in visual studio, I edited the .csproj to build another project like this: ... <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Target Name="BeforeBuild"> <MSBuild Projects=".\other.mproj"/> </Target> ... Where other.mproj is: <?xml version="1.0" encoding="utf-8"?> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build"> <Target Name="Build"> <Message Text="kikou" /> </Target> </Project> After

Build doesn't work from VisualStudio, but is ok from msbuild

元气小坏坏 提交于 2019-12-02 09:52:48
From a brand new console application template in visual studio, I edited the .csproj to build another project like this: ... <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Target Name="BeforeBuild"> <MSBuild Projects=".\other.mproj"/> </Target> ... Where other.mproj is: <?xml version="1.0" encoding="utf-8"?> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build"> <Target Name="Build"> <Message Text="kikou" /> </Target> </Project> After a while I discovered that modifying the content of other.mproj (for instance, by introducing errors or

Showing errors from a build-time tool with source file/line

*爱你&永不变心* 提交于 2019-12-02 06:29:08
问题 My project has an MSBuild target which runs a tool which generated some files: <Exec Command="$(MyTool) @(Content)" ConsoleToMSBuild="true" IgnoreExitCode="False" LogStandardErrorAsError="true" /> If the tool detects some error in its inputs (the @(Content) files), it outputs the error to standard error. This makes MSBuild to fail the build, and Visual Studio to show this text in the error list - all of which is great! Now, the tool also knows the exact file&line where the error is, and I