msbuild-4.0

The type or namespace could not be found

房东的猫 提交于 2019-12-09 03:18:53
问题 I'm currently trying to convert a WiX 3.5 custom actions project in Visual Studio 2008 to WiX 3.7 and Visual Studio 2012 and I'm getting the following exception: The type or namespace name 'MyNamespace' could not be found (are you missing a using directive or an assembly reference?) The dll is definitely referenced and Visual Studio 2012 has no problem seeing the namespace. Everything under the namespace even pops up in Intellisense, but when I build it I'm getting this exception. Anyone have

Replace characters within an msbuild variable

ⅰ亾dé卋堺 提交于 2019-12-08 14:39:58
问题 I need to replace characters in a variable I am passing to an exec task within msbuild 4. Specifically, I need to replace all occurrences of backslashes \ with forward-slashes / in the $(MSBuildProjectDirectory) variable. eg: <Target Name="DoStuff"> <Exec Command="stuff.exe $(MSBuildProjectDirectoryWithSlashesFixed)/SomeFile.txt" /> </Target> The executable being called is an oracle component that can't deal with slashes in windows format. I've had a look at Property Functions, but as System

Remove MSBuild DLL reference regardless of version (by wildcard) in VS 2015

陌路散爱 提交于 2019-12-08 01:24:35
问题 In a C# project I have a DLL reference that I want to remove before the build (to be replaced with another - this an attempted solution to Easily override NuGet DLL in development (VS 2015)). The following target seems to work: <Target Name="BeforeBuild"> <ItemGroup Condition="Exists('..\..\..\Build\My.dll')"> <Reference Remove="My, Version=1.2.3.4, Culture=neutral, processorArchitecture=MSIL" /> <Reference Include="My, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">

cl.exe hangs indefinitely while being invoked via MSBuild

那年仲夏 提交于 2019-12-07 10:58:38
问题 I am trying to run MSBuild on my (mostly C++) projects (imagine a really humongous code base). Visual Studio 2015 is the toolset in question ( Windows 7 SP1 and VS 2015 Update 2 ). Even with /m:1 (and thereby forcing it to use only one processor) I am finding some completely random project constantly hanging at the compile phase. For example, when this issue happens, if I look at the offending project and the files it comprises of, I can see that the .obj files have been created successfully

MSBuild ItemGroup with condition

丶灬走出姿态 提交于 2019-12-07 01:00:41
问题 I don't know if ItemGroup is the right type to use. I will get 4 different booleans that will be true or false depending on choice. I would like to fill up an ItemGroup with this "strings" depending on the true or false. Is that possible or what should I use? Example Anders = true Peter = false Michael = false Gustaf = true My ItemGroup should then have Anders and Gustaf. Is that possible or how should I solve that? 回答1: Since you have a bunch of items, it would be better to store them in an

MSBUILD : error MSB1008: Only one project can be specified in teamcity

陌路散爱 提交于 2019-12-06 21:09:13
问题 I am trying to run msbuild with teamcity. I have a batch file and I pass into it parameters and the build works. When I try to run through teamcity I get error below [13:24:46][MSBuild output] Start MSBuild... [13:24:46][MSBuild output] 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe' '"@C:\TeamCity\buildAgent\work\999585556854a516\Build\Default.msbuild.teamcity.msbuild.tcargs" C:\TeamCity\buildAgent\work\999585556854a516\Build\Default.msbuild.teamcity' [13:24:46][MSBuild output]

When you import another msbuild file, what is the order of evaluation?

旧街凉风 提交于 2019-12-06 19:12:26
问题 I have a shared properties file shared.properties.proj <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <SharedAssemblySearch>$(MSBuildProjectDirectory)\..\Shared Assemblies</SharedAssemblySearch> <ParentDir>..</ParentDir> <SharedAssemblySearch Condition="!Exists('$(SharedAssemblySearch)')">$(ParentDir)\$(SharedAssemblySearch)</SharedAssemblySearch> <SharedAssemblySearch Condition="!Exists('$(SharedAssemblySearch)')">$(ParentDir)\$(SharedAssemblySearch)<

Why is $([System.Text.RegularExpressions.Regex]::IsMatch()) evaluated once in ItemGroupDefinition?

强颜欢笑 提交于 2019-12-06 10:49:05
问题 So fiddling with MSBuild tasks, and I am finding that a Regex metadata property is evaluated once rather than per item. For example <!-- actual items, we use standard project reference items and extend via ItemDefinitionGroup. add project references through IDE to extend coverage --> <ItemGroup> <ProjectReference Include="..\Example.UnitTests-x86\Example.UnitTests-x86.csproj"> <Project>{7e854803-007c-4800-80f9-be908655229d}</Project> <Name>Example.UnitTests-x86</Name> </ProjectReference>

My project builds with MSBuild 4 but not with MSBuild 3.5 even though I'm targeting the same version of the .NET Framework (3.5)?

给你一囗甜甜゛ 提交于 2019-12-06 06:48:00
问题 When I build my solution using MSBuild 4 it compiles successfully: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe MySolution.sln Build succeeded. 0 Warning(s) 0 Error(s) But when I try to do the same using MSBuild 3.5 I get the following error, even though the source is the same and I am using the same libraries and the same version of the .NET Framework. C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe MySolution.sln error CS1501: No overload for method

Remove MSBuild DLL reference regardless of version (by wildcard) in VS 2015

那年仲夏 提交于 2019-12-06 06:18:23
In a C# project I have a DLL reference that I want to remove before the build (to be replaced with another - this an attempted solution to Easily override NuGet DLL in development (VS 2015) ). The following target seems to work: <Target Name="BeforeBuild"> <ItemGroup Condition="Exists('..\..\..\Build\My.dll')"> <Reference Remove="My, Version=1.2.3.4, Culture=neutral, processorArchitecture=MSIL" /> <Reference Include="My, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\Build\My.dll</HintPath> </Reference> </ItemGroup> <