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

The Visual Studio Build tools are a different download than the IDE. They appear to be a pretty small subset, and they’re called Build Tools for Visual Studio 2019 (download). You can use the GUI to do the installation, or you can script the installation of msbuild: vs_buildtools.exe –add Microsoft.VisualStudio.Workload.MSBuildTools –quiet Microsoft.VisualStudio.Workload.MSBuildTools is a “wrapper” … Read more

How do I get .NET Core projects to copy NuGet references to the build output?

You can add this to a <PropertyGroup> inside your csproj file to enforce copying NuGet assemblies to the build output: <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> However, note that the build output (bin/Release/netcoreapp*/*) is not supposed to be portable and distributable, the output of dotnet publish is. But in your case, copying the assemblies to the build output is probably … Read more

Microsoft.WebApplication.targets was not found, on the build server. What’s your solution?

To answer the title of the question (but not the question about the output you’re getting): Copying the following folder from your dev machine to your build server fixes this if it’s just web applications C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications Remove x86 according to how your build breaks. If you have other project types you will probably … Read more

Conditional compilation and framework targets

One of the best ways to accomplish this is to create different build configurations in your project: <PropertyGroup Condition=” ‘$(Framework)’ == ‘NET20’ “> <DefineConstants>NET20</DefineConstants> <OutputPath>bin\$(Configuration)\$(Framework)</OutputPath> </PropertyGroup> <PropertyGroup Condition=” ‘$(Framework)’ == ‘NET35’ “> <DefineConstants>NET35</DefineConstants> <OutputPath>bin\$(Configuration)\$(Framework)</OutputPath> </PropertyGroup> And in one of your default configurations: <Framework Condition=” ‘$(Framework)’ == ” “>NET35</Framework> Which would set the default if it … Read more

MSBuild doesn’t copy references (DLL files) if using project dependencies in solution

I just deal with it like this. Go to the properties of your reference and do this: Set “Copy local = false” Save Set “Copy local = true” Save and that’s it. Visual Studio 2010 doesn’t initially put: <private>True</private> in the reference tag and setting “copy local” to false causes it to create the tag. … Read more

Compile Views in ASP.NET MVC

From the readme word doc for RC1 (not indexed by google) ASP.NET Compiler Post-Build Step Currently, errors within a view file are not detected until run time. To let you detect these errors at compile time, ASP.NET MVC projects now include an MvcBuildViews property, which is disabled by default. To enable this property, open the … Read more

Xamarin On Windows C#

First off, there’s not really a question here, you just posted an error message with no context, is anything breaking? If so, what? You need to analyze the error message before asking your question. To start, the global assembly cache is a place on your machine that Windows uses to reference commonly used assemblies, so … Read more