Teamcity and MSBuild 4.5 - msbuild

Is there any way to target framework 4.5 and use MSBuild 4.5 in Teamcity? My search so far has been vain.

It seems like JetBrains is planning on adding MSBuild 4.5 support to the next minor release of TeamCity (see issue TW-20629).

Related

MsBuild failing for .Net Standard project with error "Package System.Security.Cryptography.ProtectedData, version x.x.x was not found"

Project Setup : Mixed framework solution
.Net Framework 4.6.2 projects in solution : 15
.Net Standard 2.0 projects in solution - 1
Development Machine
Visual Studio 2017(15.7.4) : Builds without any errors
Build Server
TeamCity Version 2017.1.3
Build Steps
Nuget Restore(3.4.4)
dotnet Restore
MSBuild( Build Tools 2017), Tools Version 15.0
Build fails with following error in the .net standard 2.0 project : [ResolvePackageAssets] C:\Program Files\dotnet\sdk\2.1.301\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(198, 5): Package System.Security.Cryptography.ProtectedData, version 4.4.0 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions.
What's interesting is I can't find reference or use of System.Security.Cryptography.ProtectedData anywhere in the project. Any help is greatly appreciated.
P.S - Can't use dotnet build, as the solution needs building of licenses.licx files, and the component which builds it (Microsoft.Build.Tasks.LC) is not ported to .Net Core. The suggestion from various posts was to use MsBuild.exe

MSBuild error - Solution is of version 12.00 which is not currently supported

I have a Build server which has TFS 2010 Build Service installed. I have 2 Build Agents and 1 Controllers configured. One of our projects have been converted to Visual Studio 2012.
I found out that .NET framework 4.5 comes with new version of MSBuild which is version 4.5.
I installed .NET framework 4.5 on the Build Server because prior to installing it every time the project was built I kept getting the following error:
"Solution is of version '12.00' which is not currently supported".
After installing .NET 4.5, I still run into the same issue.
How could I go about resolving this?
Do I have to configure the Build Agent to use the new MSBuild 4.5 in order to build this particular project or do I set something in the projects solution file itself? If so how?
I would really appreciate if somebody could assist me with this please?
Try install vs2012 on the build server, while i don't believe it's strictly needed it's the easiest way to get all the requirements installed.
We have installed VS2012 on the build agent. Interestingly when I RDC to the build agent and then run msbuild from the command line everything works fine. So the issue looks like it happens before we even get to MSBuild.

Targeting the 3.5 Framework using MSBuild 4.0 Assembly Conflict

I'm attempting to create a 3.5 build from a 4.0 set of code. It almost works the following msbuild options: /tv:3.5 /p:targetframeworkversion=v3.5. The issue is that I get a conflict for those classes that have moved to new assemblies in 4.0, for example:
error CS0433: The type 'System.Web.Security.RoleProvider' exists in both 'c:\Windows\Microsoft.NET\assembly\
GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.W
eb.ApplicationServices.dll' and 'c:\Windows\Microsoft.NET\Framework\v2.0.50727\
System.Web.dll'
How do I tell msbuild to pickup the System.Web assembly? Can I tell it to ignore the 4.0 directory?
sounds like a similar issue to what we had, ended up with Hf from Microsoft
TFS2008 to TFS2010 migration upgrade

Target specific version of .NET with MSBuild

I have a solution that is being referenced by a MSBuild project. In the solution, I am referencing several projects that are targeting .NET 4.0. How can I tell MSBuild to ignore the project's configuration and just target .NET 3.5?
A command similar to the following should work
msbuild YourSolution.sln /tv:3.5 /p:TargetFrameworkVersion=v3.5
or
msbuild YourSolution.sln /p:TargetFrameworkVersion=v3.5
/tv (or /toolsversion) Indicates which version of the MSBuild tools you want to use, and the property TargetFrameworkVersion indicates the target framework. In your case just specifying that property should be fine, but if you want to use the 3.5 MSBuild toolset you can sepcify it with /tv as I did in the first command.

MSBuild vs nant

We were using nant for building our project (10+Class Lib) and a Web Site which was based on the ASP.NET 2.0. Recently we are in the process of moving towards the ASP.NET 3.5. I searched in the net and found that nant doesn't support 3.5.
I am also looking in to option of migrating MSBuild.
Is the MS Build right candidate for this?
I heard people saying that MSBuild is slow? is it True?
With MS Build can I have a Single step build ? in nant all I will do is to call nant.ext and give a build file it will do a build and give me the output.
NAnt can easily be made to support .NET 3.5 - we use it here. Rather than claim credit, check this blog post.
Have a look at the Nant Site
.net Framework 3.5 is supported
In MsBuild you can have a single step build. Nant can be used with .Net 3.5 but is always behind the times (.Net 4.0 is soon to be shipped). Nant .86 beta1 has issues with x64 Windows Server 2003 (You will need to use a nightly build). I have used both and prefer MsBuild. For more details check out an older blog post I wrote Nant vs MsBuild