msbuild

TeamCity - Microsoft.Bcl.Build Dependency

拟墨画扇 提交于 2019-12-20 02:13:48
问题 I've just committed some code changes to my repository and all of a sudden (after weeks of being fine). The TC build starts failing as it fails to download the NuGet package for Microsoft.Bcl.Build.1.0.6. I ended up having to manually copy the contents of the packages directory to the TC build location which utterly defeats the point of NuGet. What can I check to get to the root cause of this? Everything about NuGet is enabled in the solution for getting packages. 回答1: I've blogged about this

How to always execute a target in MSBuild

前提是你 提交于 2019-12-20 01:57:15
问题 I have an MSBuild file that manipulates the AssemblyInfo file before the application is compiled. At the end of the build, it restores the AssemblyInfo file. It does this by backing up the file, manipulating it, and then after build time, restoring the file. This works fairly well except when an error occurs during the build. It then does not restore the original file. Is there a way I can tell MSBuild to execute a target at the end of a build no matter if it succeeded or failed? 回答1: What

How do I zip a folder in MSBuild?

喜你入骨 提交于 2019-12-20 01:39:43
问题 How do I zip an output folder in MSBuild? For the filename I need to use a variable that gets set elsewhere. 回答1: "MSBuild.Community.Tasks.Zip" is one way. WorkingCheckout and OutputDirectory are not defined. But you can get the drift below. The below will get all files that are not .config files for my zip. Note "Host" is my custom csproj folder name, yours will be different. <ItemGroup> <ZipFilesHostNonConfigExcludeFiles Include="$(WorkingCheckout)\Host\bin\$(Configuration)\**\*.config" />

Visual Studio 2010 cannot load a project where the <ProjectConfiguration> elements are imported

帅比萌擦擦* 提交于 2019-12-20 01:34:47
问题 We have a large (~800 individual projects) system that we are migrating from an old build system up to Visual Studio 2010. Over the last few weeks, we have manually created Visual Studio project files (.vcxproj format) for each of the projects and we are able to build the entire system from the command line using only MSBuild.exe (WIN!!). Because of the large number of projects that needed to be converted, it was more efficient to create the project files by hand than to create them using the

Add Custom Metadata to Already-defined ItemGroup from Another ItemGroup

穿精又带淫゛_ 提交于 2019-12-19 19:55:10
问题 I have the following: <ItemGroup> <Files Include="C:\Versioning\**\file.version" /> <ItemGroup> <ReadLinesFromFile File="%(Files.Identity)"> <Output TaskParameter="Lines" ItemName="_Version"/> </ReadLinesFromFile> where each file.version file contains simply one line which is - you guessed it - a version of the form Major.Minor.Build.Revision . I want to be able to associate each item in the Files ItemGroup with its _Version by adding the latter as metadata, so that I can do something like:

MSBuild XmlMassUpdate Task

邮差的信 提交于 2019-12-19 19:53:38
问题 I wanted to ask a quick question regarding the behaviour of the MSBuild task XmlMassUpdate. Has anyone found that the task will only copy unique nodes over to the content XML? For example, if I have a client node which has multiple children called endpoint, then it will only mass copy the first endpoint node while eliminating all the others. I've provided some examples below of what I'm describing, many thanks in advance. MSBuild Task: <Project DefaultTargets="Run" xmlns="http://schemas

How to specify the equivalent of /features:strict (of csc.exe) to msbuild.exe or in the .csproj file?

旧街凉风 提交于 2019-12-19 19:33:20
问题 Introduction Consider this simple (and bad) C# class: using System; namespace N { static class C { static void M(DateTime d) { if (d == null) Console.WriteLine("Yes"); else Console.WriteLine("No"); } static void L(object o) { if (o is Nullable) Console.WriteLine("Yes"); else Console.WriteLine("No"); } } } Both methods M and L have serious issues. In M , we ask if a value of the non-nullable struct DateTime is equal to null via the lifted == operator (which exists since DateTime overloads

Make each csproj in a solution target a different C# version

亡梦爱人 提交于 2019-12-19 19:15:04
问题 I have a solution that contains five C# console application projects. I would like each project to target a different version of C#. MyLearningSolution.sln CSharp01.csproj CSharp02.csproj CSharp03.csproj CSharp04.csproj CSharp05.csproj Is there a way to do this either via Visual Studio or via editing each csproj file? I have tried the following searches: csproj target specific C# version , this talks about targeting a specific framework version csproj choose c# version , doesn't answer the

Make each csproj in a solution target a different C# version

时间秒杀一切 提交于 2019-12-19 19:14:04
问题 I have a solution that contains five C# console application projects. I would like each project to target a different version of C#. MyLearningSolution.sln CSharp01.csproj CSharp02.csproj CSharp03.csproj CSharp04.csproj CSharp05.csproj Is there a way to do this either via Visual Studio or via editing each csproj file? I have tried the following searches: csproj target specific C# version , this talks about targeting a specific framework version csproj choose c# version , doesn't answer the

Built with optimizations enabled or without debug information

一曲冷凌霜 提交于 2019-12-19 14:27:30
问题 I'm currently trying to find out why my InjectableAttributes never get to the filter part. Therefor I linked in the source project directly so I could easily put breakpoints etc. When I build however I get the following message: The following module was built either with optimizations enabled or without debug information: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\[a bunch of randomly named directories]\assembly\[more random names]\MvcTurbine.Web.DLL] To debug