msbuild

Pass list item to Properties when calling reusable msbuild target

坚强是说给别人听的谎言 提交于 2019-12-24 03:07:28
问题 I'm trying to create a reusable Target in msbuild, following the basic model outlined in How to invoke the same msbuild target twice? I'm stuck trying to pass a property that I want interpreted as a list. I haven't found an example online that deals with this situation. As I understand it, the problem is that Properties is already treated as a list item, so it doesn't like having a list item passed in as well. Is there a way to get msbuild to pack and unpack the list correctly here? Msbuild

Does Roslyn actually allow you to manipulate TreatWarningsAsErrors for a CSharp project?

时光总嘲笑我的痴心妄想 提交于 2019-12-24 02:54:08
问题 I'm trying to retrieve the setting TreatWarningsAsErrors, but I'm unable to find it for a project of my loaded solution. What I'm trying to accomplish, is to get the setting from the project files, and set it to true , if it's not already that. Next, I want to let Roslyn do a compilation with the new setting, so I can check if this will break the project. I've looked at various places, among others, the Project.CompilationOptions . Most options to a project build are there, except this one.

Without editing the csproj file, get MSBuild to copy all files marked as Content to a folder, preserving folder structure?

女生的网名这么多〃 提交于 2019-12-24 02:23:56
问题 Question Ultimately, we would like to use the command line to copy all files that a csproj has marked as Content , while preserving the directory structure, and without editing the original csprog file. We have seen How can I get MSBuild to copy all files marked as Content to a folder, preserving folder structure? This doesn't work for us, because it involves editing the csproj file. We want to avoid doing that. MSBuild? We've thought of using msbuild via the command line but we don't know

Updating to .Net 4.7.1 Framework

烈酒焚心 提交于 2019-12-24 02:18:56
问题 So I have a project that has been around since 2011 with intermittent additions for Libraries and additional projects within the Solution. I am attempting to update it to 4.7.1 for all libraries and projects to which I have all the libraries and projects set to the 4.7.1 frameworks in Properties -> Application -> Target framework, however, I am getting warnings, debug errors, and a slew of other issues related to framework where: 1) when I try to debug it says "this error is because you are

MSBuild: convert relative path in imported project to absolute path

左心房为你撑大大i 提交于 2019-12-24 02:16:29
问题 Short version: I have an MSBuild project that imports another project. There is a property holding a relative path in the imported project that is relative to the location of the imported project. How do I convert this relative path to be absolute? I've tried the ConvertToAbsolutePath task, but this makes it relative to the importing project's location). Long version: I'm trying out Robert Koritnik's MSBuild task for integrating nunit output into Visual Studio (see this other SO question for

ccrewrite fails on the build machine due to nuget references having contract assemblies

橙三吉。 提交于 2019-12-24 01:54:35
问题 Here is the whole context: I build two nuget packages containing A.nupkg: A.dll, A.Contracts.dll B.nupkg: B.dll, B.Contracts.dll; B depends on A I create a new project and solution C depending on A and B, and set "Contract Reference Assembly" to Build. Locally, everything compiles just fine. However, on the build server (MSBuild 2012.2), an exception is thrown from ccrewrite, saying ccrewrite : error : Rewrite aborted due to metadata errors. Check output window . Setting the logging to

MSBuild merge item groups

夙愿已清 提交于 2019-12-24 01:43:30
问题 Need some help with this MSBuild code. I want to generate 4 app.config files with different settings and create 2 setup files for QA and production. Each setup file will have 2 physical installations (Production lines). So QA setup should include 2 app.configs with qa settings for production line 1 and 2, the same for production setup. Here is a extract of the msbuild I have so far. <ItemGroup> <BuildEnvironment Include="QA"> <Server>qa-server</Server> <BuildEnvironment/> <BuildEnvironment

Build project in VS2015: “csc.exe” exited with code -1073741571

梦想的初衷 提交于 2019-12-24 01:15:38
问题 I was using Visual studio 2013. Yesterday, I installed VS2015(enterprise update 3). The build process for my solution crashes in VS2015 for one of the projects. The same exception occurs with VS2017 RC. The solution was building succesfully in VS2013. The solution is targeting .Net4.5. When I migrate to .Net4.6.2, it does not solve this issue. I believe the problem is coming with compiler included in VS2015+ Output : Process is terminated due to StackOverflowException. C:\Program Files (x86)

how to get extension name (without dot) in MSBuild

青春壹個敷衍的年華 提交于 2019-12-24 01:02:44
问题 I have an ItemGroup, and I use its metadata as identifiers in my MSBuild project for batch processing. For example: <BuildStep TeamFoundationServerUrl="$(TeamFoundationServerUrl)" BuildUri="$(BuildUri)" Name="RunUnitTestsStep-%(TestSuite.Filename)-%(TestSuite.Extension)" Message=" - Unit Tests: %(TestSuite.Filename): %(TestSuite.Extension)"> <Output TaskParameter="Id" PropertyName="RunUnitTestsStepId-%(TestSuite.Filename)-%(TestSuite.Extension)" /> </BuildStep> However, this will not work,

MSBuild: OutputPath directory is empty

≯℡__Kan透↙ 提交于 2019-12-24 00:56:48
问题 I want to deploy my ASP.NET MVC site and have the following script. <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="..\MyProjName\MyProjName.csproj"/> <PropertyGroup> <NewInstallDir>C:\DeployFolder\</NewInstallDir> <BinDir>$(NewInstallDir)bin\</BinDir> </PropertyGroup> <Target Name="Build"> <MSBuild Projects="..\MySlnName.sln" Properties="Configuration=Release;Platform=Any CPU