msbuild

Does the MSBuild Exec task search STDOUT for the string “error”?

拜拜、爱过 提交于 2020-02-01 04:26:45
问题 I have a small NUnit test suite with a single ignored test. I'm just now writing a simple MSBuild script to restore and publish and the like. I tried to get a dotnet test task working <Target Name="test" DependsOnTargets="restore"> <Exec Command="dotnet test" WorkingDirectory="test\Example.Tests" /> </Target> But, it exits with code -1 every time! PS> dotnet msbuild /t:test build.xml Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core Copyright (C) Microsoft Corporation. All

MSBuild - Set Properties For Solution

僤鯓⒐⒋嵵緔 提交于 2020-02-01 00:35:08
问题 We are using .NET 3.5 with VS2008. I have a solution with ~20 projects in it, and that number will grow over time as the application grows and adds new modules. Today I needed to set a property on every project. I had to edit each csproj file to add the following: <Target Name="BeforeBuild"> <CreateProperty Condition=" '$(SolutionDir)' != '' And '$(SolutionDir)' != '*Undefined*' " Value="$(SolutionDir)Tools\MSBuild"> <Output TaskParameter="Value" PropertyName="AlToolPath" /> </CreateProperty>

Visual Studio build successful, MSBuild fails

杀马特。学长 韩版系。学妹 提交于 2020-01-31 23:15:50
问题 I am trying to clean and rebuild a solution file with multiple projects from the command line using MSBUILD. For some reason my build fails (about 10% of the built projects fail) and I get multiple errors which all look like: error CS0234: The type or namespace name 'foo' does not exist in the namespace 'bar' (are you missing an assembly reference?) Now if I clean and rebuild the same solution file from Visual Studio 2010 with the exact same configurations it will build successfully with no

Visual Studio build successful, MSBuild fails

北城以北 提交于 2020-01-31 23:14:27
问题 I am trying to clean and rebuild a solution file with multiple projects from the command line using MSBUILD. For some reason my build fails (about 10% of the built projects fail) and I get multiple errors which all look like: error CS0234: The type or namespace name 'foo' does not exist in the namespace 'bar' (are you missing an assembly reference?) Now if I clean and rebuild the same solution file from Visual Studio 2010 with the exact same configurations it will build successfully with no

What are the differences between Microsoft.NET.Sdk and Microsoft.NET.Sdk.Web

老子叫甜甜 提交于 2020-01-31 21:12:52
问题 I have a solution with two host projects (one is a Web Host and the other is a Generic Host) and a class library project referenced by those two host projects. In the Sdk attribute of the root tag <Project> of the *.csproj file, both host projects (web host and generic host) are using Microsoft.NET.Sdk.Web , but the class library project uses the Microsoft.NET.Sdk . The two host projects references the Microsoft.AspNetCore.App metapackage. The class library project are using Microsoft.NETCore

XAML MSBuild task XamlMarkupCompilePass1 fails in parallel MSBuild and throws error Access denied

被刻印的时光 ゝ 提交于 2020-01-31 12:09:57
问题 We have several projects containing XAML UI and XAML workflow files. Since we enabled execution of MSBuild in parallel, with the flag /m the builds, from time to time we get an exception in the MSBuild task XamlMarkupCompilePass1 ##[error]C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Xaml.targets(193,5): Error XC1000: XC1020: Build error occurred in the XAML MSBuild task: 'Could not load file or assembly 'file:///C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\

Getting an error Cannot resolve dependency to assembly System.Web

喜夏-厌秋 提交于 2020-01-30 08:12:26
问题 I had to have my primary HD replaced. Yesterday my HD was replaced by our IT tech staff. So today, after installing VS 2015, I started working on a WPF app we've been working on. I got into the project, did a Get Latest from TFS and did a build. I failed with the following error: Cannot resolve dependency to assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must

Getting an error Cannot resolve dependency to assembly System.Web

青春壹個敷衍的年華 提交于 2020-01-30 08:12:05
问题 I had to have my primary HD replaced. Yesterday my HD was replaced by our IT tech staff. So today, after installing VS 2015, I started working on a WPF app we've been working on. I got into the project, did a Get Latest from TFS and did a build. I failed with the following error: Cannot resolve dependency to assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must

Conditionally changing target framework version

泪湿孤枕 提交于 2020-01-30 06:02:23
问题 I'm trying to compile an #ifdef'd codebase to two different target frameworks, namely 3.5 and 4.0. I attempted to modify the .proj files in the solution to no avail. It seems MSBuild / VS2012 isn't picking up the solution configuration change via UI. This is a fragment of one of the .proj files: <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>..\Binaries\</OutputPath> <DefineConstants>TRACE

Conditionally changing target framework version

有些话、适合烂在心里 提交于 2020-01-30 06:02:05
问题 I'm trying to compile an #ifdef'd codebase to two different target frameworks, namely 3.5 and 4.0. I attempted to modify the .proj files in the solution to no avail. It seems MSBuild / VS2012 isn't picking up the solution configuration change via UI. This is a fragment of one of the .proj files: <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>..\Binaries\</OutputPath> <DefineConstants>TRACE