msbuild

Batch files in Visual Studio 2008

吃可爱长大的小学妹 提交于 2019-12-12 17:24:41
问题 I need help with a very frustrating problem with Visual Studio 2008. I have a project in C# which calls, during the pre-compilation phase, a batch file which copies some dlls into a sub-directory of the project itself. It often happens that Visual Studio reports an error caused by the execution of the batch file: it says that the execution had terminated with code 1. After that, the only solution to compile again the project is restarting Visual Studio. Once restarted, the compilation doesn't

MSBuild does not work anymore with Tokyo

邮差的信 提交于 2019-12-12 17:04:56
问题 I have multiple project groups that I want to compile at batch. There are over 100 projects in there. In 2010 we had a "make" file like this: call "c:\Borland\RAD Studio\19.0\bin\rsvars.bat" "c:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" /t:Clean,Build Group1.groupproj Under Tokyo it does not work anymore. I get: C:\Borland\RAD Studio\19.0\Bin\CodeGear.Cpp.Targets(3695,5): error : Error: Unable to open file 'L_ER_FD.RES' [P:\Ent\_common\er\prj\l_er_fd.cbproj] However, the project group

In MSBuild, why isn't Item Metadata, within a property, being resolved?

試著忘記壹切 提交于 2019-12-12 17:03:07
问题 Below is a portion of a MSBuild file that I'm working on: <ItemGroup> <Tests Include="$(SolutionDir)\**\bin\$(TestPlatform)\$(Configuration)\*.Tests.dll" /> </ItemGroup> <PropertyGroup> <TestProperties>/testcontainer:%(Tests.FullPath)</TestProperties> </PropertyGroup> I want to have a property that holds a command line switch. However, when I try to use $(TestProperties) in an Exec Command string, %(Tests.FullPath) is never resolved to the absolute path of the Tests item. Instead, it's always

How to analyze existing .cs files with SonarQube Scanner for MSBuild?

跟風遠走 提交于 2019-12-12 16:30:13
问题 I want to scan existing .cs files with sonarqube. I understood that I need to use SonarQube Scanner for MSBuild, and this one requires to create a project to analyze. So I created a project on Visual studio from existing files and declared it as Class Library. But while executing SonarQube Scanner for MSBuild, I've got this error: WARNING: The project has an invalid GUID "00000000-0000-0000-0000- 000000000000". The project will not be analyzed by SonarQube. Project file: C:\Users\sas1

Conditionally exclude files from VisualStudio 2013 C++ project based on file name

。_饼干妹妹 提交于 2019-12-12 16:18:34
问题 I'm trying to get Visual Studio 2013's msbuild .vcxproj to automatically mark certain .cpp project files as <ExcludedFromBuild>true</ExcludedFromBuild> based on the .cpp filename. My goal is to allow my program (~100 developers, ~1000 vcxproj) to easily support Debug only compilations of unit test code, that would all be written in .cpp files that had a _utest.cpp suffix. Any .cpp files that ended in _utest.cpp would be automatically excluded from a release build, and the programmer could see

TFS Builds: Running the builds as administrator

允我心安 提交于 2019-12-12 15:18:58
问题 We have one of our build projects that modifies the registry on the build machine (don't ask me why) and it needs to be done as administrator. Is there some way to run msdev from the build agent as "administrator"? We're using TFS 2012, soon to move to TFS 2013. - Bruce 回答1: Add the build service account to the local Administrators group 回答2: Even though it's late - adding to Vian's answer, adding the account to the local Admin groups is probably the way to go here. Someone who is an Admin on

Pass value from MSBuild Task to TFS Build Workflow

☆樱花仙子☆ 提交于 2019-12-12 15:14:57
问题 There are numerous examples and ways on passing a property value from TFS 2010 Build Workflow into MSBuild however I need to do the reverse. Basically on the build boxes custom target files have been written to do some processing on all the builds that run on the boxes. These target files have custom tasks in them some of which expose return values (or output parameters). I would like to be able to read the values of these output parameters from within the build workflow (TFS 2010) if

Delete files older 6 months

最后都变了- 提交于 2019-12-12 14:55:41
问题 I want delete files in a folder, which are more than six months old -older than 6 months-using Msbuild. I want use %ModifiedTime (Well-known Item Metadata) of MsBuild I prefer not use customs Tasks, only msbuild default and Microsoft.Sdc.Tasks. I use VS 2008, .net .35. Any suggestions ? <Target Name="SomeTarget"> <ItemGroup> <FilesToDelete Include="Path\**\*.zip"/> </ItemGroup> <Delete Files="@(FilesToDelete)" /> </Target> 回答1: I think you can achieve this without need to use custom tasks in

Removing Unit Test dll files when using WIX

醉酒当歌 提交于 2019-12-12 14:31:48
问题 I'm trying to create an MSI for my project using WIX. I've got HEAT pointing to the correct directory and the file it spits out is correct, but for some reason when I actually run MSBuild on it it's also giving me all of my unit test dll files. Anyone have any idea how to remove those from the build process? 回答1: One option would be to write an XSL transformation modifying the generated HEAT output (e.g. removing the unwanted files): heat.exe dir <other arguments> -t my.xsl To remove a

MSBuild multiple outputpath

心已入冬 提交于 2019-12-12 14:23:02
问题 I saw this S.O question and have a similar requirement. This is what I have in a .targets file - <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup Condition="$(TeamBuildOutDir) != '' "> <OutputPath>$(TeamBuildOutDir)\Assemblies</OutputPath> </PropertyGroup> How can I output to multiple folders? e.g.- $(TeamBuildOutDir)\Assemblies2 TIA Thanks Nick, The copy/paste mucked it up. This is what I tried - <Project xmlns="http://schemas.microsoft.com/developer