msbuild

How to automatically insert version number into AssemblyName

风格不统一 提交于 2019-12-22 10:32:57
问题 I'm trying to build upon this question: Reading a single value from a file in MSBuild My goal is to have a single place to put the version number that's used in several projects, and I also want a portion of the version number in the DLL file name for one of the projects. Based on the question above, I already got the first part, but I'm having difficulty with the second part and would appreciate some guidance. In my solution, I set up a plain text file called Version.txt containing my full

How can I execute programs in my %PATH% with MSBuild?

筅森魡賤 提交于 2019-12-22 10:24:08
问题 Note: I'm using Mercurial as an example here, because that's what I'm trying to get to work with MSBuild right now. But the problem is not limited to Mercurial, it happens with every external program that is somewhere in my %PATH% variable (I tried the same with PowerShell, for example). So I didn't put the Mercurial tag on this question on purpose, because this is not about Mercurial! What I actually want to do: I want my build script to get the current revision number from my Mercurial

The type arguments for method cannot be inferred from the usage

*爱你&永不变心* 提交于 2019-12-22 09:50:59
问题 namespace TestLibrary { [TestFixture] public class Class1 { public delegate T Initializer<T>(); public static T MyGenericMethod<T>(Initializer<T> initializer) where T : class { return initializer != null ? initializer() : null; } [Test] public void Test() { var result = MyGenericMethod(MyInitializer); Assert.IsNotNull(result); } private object MyInitializer() { return new object(); } } } This is a functioning piece of code when running in Visual Studion 2010. If I try to build this using

When and why Visual Studio creates the “x86” subfolder inside “bin” after build?

久未见 提交于 2019-12-22 09:49:45
问题 I have a solution with many projects, containing 3 executable projects. All of my projects are configured to target "x86" platform, in the solution configuration manager I've even deleted the others like "Mixed" and "Any CPU" (this is becuase I'm using some third party libraries which are restricting me to stick with x86). All 3 executable projects are simple WinForms applications built with C#, targetting .NET 4 full profile. Now when I build one of my executable projects, its output is

How to both package with msbuild and run tests on TFS 2010 using Continuous Integration

天涯浪子 提交于 2019-12-22 09:39:21
问题 I am using TFS2010 and MSBuild to integrate a windows azure cloud solution to the CI. To create the required 2 files for deployment I added in the "MSBuild Arguments" the /t:Publish Here is the configuration I use in TFS to build the packages: Problem is : if I remove all arguments the tests are built correctly but no azure package is built as seen on the build results: Tho if I put the parameters the package is there but the test are not run : Is there a way to have both ? 回答1: I had

How can I prevent bad project references?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 09:19:11
问题 We are using C# projects with TFS as source control and for the CI builds. I keep finding that other developers are referencing assemblies from /Bin directories incorrectly when they should be using our /Libs folder (where we keep 3rd party assemblies) What can I do as part of the solution build or CI build (we do also use powershell) to check and fail the build if anyone does this? 回答1: Add a custom activity to your build process template. The activity's pseudo code should look like: Execute

How to build a PropertyGroup entry from an ItemGroup in MSBuild?

爱⌒轻易说出口 提交于 2019-12-22 09:18:25
问题 I'm very new to MSBuild and am having trouble figuring out how to construct a PropertyGroup entry from conditional parts. Here's what I have, which is not working: <ItemGroup> <CompilerDirective Include="DEBUG_PARANOID" Condition=" '$(SomeFlag)' == 'true' "/> <CompilerDirective Include="DEBUG"/> <CompilerDirective Include="TRACE"/> </ItemGroup> <PropertyGroup> ... <DefineConstants>@(CompilerDirective)</DefineConstants> ... </PropertyGroup> I'd like the constants that get defined to show up as

Relationship between SonarQube Runner and SonarQube.MSBuild.Runner

寵の児 提交于 2019-12-22 08:49:14
问题 Regarding the announcement of SonarQube integration with MSBuild and Team Build, can anyone advise on the relationship between SonarQube Runner and SonarQube.MSBuild.Runner? I'm unclear whether SonarQube.MSBuild.Runner replaces SonarQube Runner or whether it sits on top of it. 回答1: @Techtwaddle is correct: the MSBuild.Runner invokes the sonar-runner. The MSBuild.Runner v0.9 does the following: fetches configuration settings from the SonarQube server; gathers information during the MSBuild

Find a file in the parent folders with msbuild

给你一囗甜甜゛ 提交于 2019-12-22 08:47:51
问题 In MsBuild it is possible to create a build.proj.user file which is parsed by the Microsoft.Common.Targets build file. I want to have a similar system in place where it is possible to have a .user file in the root of the folder and make msbuild pick up the config settings from this file. Take for example these paths: c:\working\build.proj.user c:\working\solution1\build.proj.user c:\working\solution1\project1\ c:\working\solution1\project2\ c:\working\solution1\project3\build.proj.user c:

TFS 2015 Build: Test results not being published

不打扰是莪最后的温柔 提交于 2019-12-22 08:46:41
问题 I'm having a really weird error when TFS 2015 executes an automated test step. The results are generated, but it seems TFS unable to find them. In the end, it just says that no results were found to publish (which is weird, because it even outputs the result full path) Check below the build logs for more info: 2015-12-16T15:44:29.5816976Z Executing the powershell script: C:\TfsBuildAgents\VsoBuildAgent\tasks\VSTest\1.0.22\VSTest.ps1 2015-12-16T15:44:29.7066995Z ##[debug]Calling Invoke-VSTest