msbuild

MSBuild Script and VS2010 publish apply Web.config Transform

ε祈祈猫儿з 提交于 2019-12-17 05:33:05
问题 So, I have VS 2010 installed and am in the process of modifying my MSBuild script for our TeamCity build integration. Everything is working great with one exception. How can I tell MSBuild that I want to apply the Web.conifg transform files that I've created when I publish the build... I have the following which produces the compiled web site but, it outputs a Web.config, Web.Debug.config and, Web.Release.config files (All 3) to the compiled output directory. In studio when I perform a

Path to MSBuild

浪尽此生 提交于 2019-12-17 04:12:25
问题 How can I programatically get the path to MSBuild from a machine where my .exe is running? I can get the .NET version from the Environment but is there a way of getting the correct folder for a .NET version? 回答1: Poking around the registry, it looks like HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\2.0 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\3.5 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0 may be what you're after; fire up regedit.exe and

Path to MSBuild

你说的曾经没有我的故事 提交于 2019-12-17 04:12:00
问题 How can I programatically get the path to MSBuild from a machine where my .exe is running? I can get the .NET version from the Environment but is there a way of getting the correct folder for a .NET version? 回答1: Poking around the registry, it looks like HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\2.0 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\3.5 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0 may be what you're after; fire up regedit.exe and

Resolving MSB3247 - Found conflicts between different versions of the same dependent assembly

◇◆丶佛笑我妖孽 提交于 2019-12-17 03:44:27
问题 A .NET 3.5 solution ended up with this warning when compiling with msbuild. Sometimes NDepend might help out but in this case it didn't give any further details. Like Bob I ended up having to resort to opening each assembly in ILDASM until I found the one that was referencing an older version of the dependant assembly. I did try using MSBUILD from VS 2010 Beta 2 (as the Connect article indicated this was fixed in the next version of the CLR) but that didn't provide any more detail either

How do you multi-target a .NET Core class library with csproj?

╄→尐↘猪︶ㄣ 提交于 2019-12-17 03:31:13
问题 When .NET Core still used the project.json format, you could build a class library targeting multiple frameworks (e.g. net451, netcoreapp1.0). Now that the official project format is csproj using MSBuild, how do you specify multiple frameworks to target? I am trying to look for this from the project settings in VS2017, but I am able to only target a single framework from the .NET Core frameworks (it doesn't even list the other full .NET Framework versions which I do have installed): 回答1: You

How do you multi-target a .NET Core class library with csproj?

本秂侑毒 提交于 2019-12-17 03:31:05
问题 When .NET Core still used the project.json format, you could build a class library targeting multiple frameworks (e.g. net451, netcoreapp1.0). Now that the official project format is csproj using MSBuild, how do you specify multiple frameworks to target? I am trying to look for this from the project settings in VS2017, but I am able to only target a single framework from the .NET Core frameworks (it doesn't even list the other full .NET Framework versions which I do have installed): 回答1: You

How can I install the VS2017 version of msbuild on a build server without installing the IDE?

。_饼干妹妹 提交于 2019-12-17 02:34:15
问题 Historically, this has been done with the Microsoft Build Tools. But it seems that the Build Tools may not be available for versions after 2015. The replacement appears to be the Visual Studio build tools, which doesn't seem to have a real homepage yet. I downloaded the VS2017 Professional installer, and went to the Individual Components tab. Right away, the summary is telling me that the Visual Studio core editor is there, taking up 753MB. I don't want the editor. Just msbuild. There is no

Detect target framework version at compile time

眉间皱痕 提交于 2019-12-17 01:40:03
问题 I have some code which makes use of Extension Methods, but compiles under .NET 2.0 using the compiler in VS2008. To facilitate this, I had to declare ExtensionAttribute: /// <summary> /// ExtensionAttribute is required to define extension methods under .NET 2.0 /// </summary> public sealed class ExtensionAttribute : Attribute { } However, I'd now like the library in which that class is contained to also be compilable under .NET 3.0, 3.5 and 4.0 - without the 'ExtensionAttribute is defined in

Are There Any Best Practices for Writing Custom NAnt, Ant, or MSBuild tasks?

喜欢而已 提交于 2019-12-14 03:49:10
问题 I'm in the process of writing a custom task for NAnt. I've been basing how I write the code based on some examples I've found on the Internet and by looking at the source of some other tasks for both NAnt and Ant. With that being said, are there any guidelines or best practices for writing good tasks for build managers like NAnt, Ant, or MSBuild? I'm looking for such in terms of exception handling and modularity (i.e. if my task does something with the file structure should I delete and

Web.config transforms - surrounding elements

左心房为你撑大大i 提交于 2019-12-14 03:45:11
问题 I am using the web.config transforms available via VS2010. In this one case I'm wondering if it possible to 'surround' an element with another during transformation. Here is an example: default web.config contains: <configuration> <system.web> .... </system.web> </configuration> My transformed file should contain <configuration> <location inheritInChildApplications="false"> <system.web> ... </system.web> </location> </configuration> So essentially I want to 'wrap' the system.web element with