Nant change Target Framework to match project - c#

I upgraded my project from .NET 3.5 to 4.5. It's working locally but not building on the server, and the problem is that Nant is trying to use MSBuild 3.5. I ran Nant locally and although it's succeeding, it says 'Target framework: Microsoft .NET Framework 2.0' and then '[property] Target framework changed to "Microsoft .NET Framework 3.5'. What do I need to change in the nant.exe.config file to make it run the right version?

In case you (or anyone else for that matter) are still looking for an answer, check https://alastaircrabtree.com/how-to-build-a-visual-studio-2013-or-2015-solution-on-a-build-server-using-nant/

Related

Is MonoDeveloper from Unity 2018.3.12f1 (latest) supporting .NET Framework 4.7.2?

This question is not a duplicate
I am scripting in Unity using C# with the build in MonoDeveloper-Tool.
When I run the script I got the error message, that the assemblys for framework ".netframework, version=v4.7.1" has not been found. I looked it up on stackoverflow and only found this article:
The reference assemblies for framework ".NETFramework,Version=v4.6.2" were not found
So I downloaded this version, but I can't install it, because I already have the latest version installed from .net framework, which is currently .NET Framework 4.7.2
Questions:
Is MonoDeveloper in "Unity 2018.3.12f1 Personal" not supporting this version?
Are there ways to upgrade it to make it work?
Or do I have to remove the .net-version, that I have and get an older one to make it work?
The message you are getting is ususally related to scripting backend setting in PlayerPreferences.
Here's a screenshot from 2017
and from 2019
It defaults to 3.5 for new projects, and you need to manually set it to 4.x, than pretty much all features from 4.7 work fine
Is MonoDeveloper in "Unity 2018.3.12f1 Personal" not supporting this version?
MonoDeveloper supports, but Unity doesn't.
Are there ways to upgrade it to make it work?
Try install .net 4.6 with Visual Studio Installer or upgrade the Unity.

Why creating an NUnit project into my solution it use an old version of .NET framework (2.1)?

I am pretty new in C# and .NET and I have the following problem.
I created a NUnit (version 3.10.1) project in my solution. The thing that I can't understand is: why the framework version is the 2.1? Is not a very old version? If I try to change it I obtain older version, I am attaching a screenshot:
The strange thing is that the other project into my solution uses the .NET 4.5.2 framnework version.
Why this NUnit project is using an old framework version? there is a way to update it?
What is wrong or what am I missing?
You are targetting .NET Core, which is a completely different framework than the Full .NET Framework.
When you create a new project, you specify the framework to target. You created this one to target .NET Core.
To change your project to target Full framework 4.5.2:
Right click the csproj and select edit <yourprojectname>.csproj
Locate the <TargetFramework> element
Change it from netcoreapp2.1 to net452
Close the csproj file
For more info on .NET Core, you should have a look at the About .NET Core documentation.
.NET Core is an open-source, general-purpose development platform maintained by Microsoft and the .NET community on GitHub. It's cross-platform (supporting Windows, macOS, and Linux) and can be used to build device, cloud, and IoT applications.
And taken from the .NET Core on Wikipedia

Error: The current .NET SDK does not support targeting .NET Standard 2.0

Getting annoying build errors since upgrading to VS2017 (v15.18.6) and dot net core 2.1.
I previously was able to build the .sln from https://github.com/MiniProfiler/dotnet.
I'm new to the whole .net standard/core stuff (frankly find MS approach to this rather confusing and annoying!).
Anyway since the upgrade to the new VS2017 build and 2.1, I get the following 2 errors:
Severity Code Description Project File Line Suppression State
Error The current .NET SDK does not support targeting .NET Standard 2.0. Either target .NET Standard 1.6 or lower, or use a version of the .NET SDK that supports .NET Standard 2.0. MiniProfiler.Shared C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.TargetFrameworkInference.targets 126
Error NETSDK1050 The version of Microsoft.NET.Sdk used by this project is insufficient to support references to libraries targeting .NET Standard 1.5 or higher. Please install version 2.0 or higher of the .NET Core SDK. MiniProfiler.Shared C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.NETFramework.targets 67
Any ideas ?
I have searched online and seem various similar issues but I don't really understand the underlying issue.
it seems you're using core and not targeting it. and it seems somehow you've brought standard and core into your app and thats causing a conflict. go through youre dependencies and references and make sure all the .NET options are set to the same either core or standard. then once youve chosen youre version, make sure to set the target to match it. standard is slightly more powerful at the moment, but its about to be depricated, so if you can switch to core and still have the functionality you need i reccomend doing do as this will increase the longevity of your project. plus linux and mac options.

Change Target Framework from 4.5 to 4.0

I am trying to change the target framework from 4.5 to 4.0, I have changed the target framework on all of my projects and I have created a testing build with VS2015.
I am trying to run the app in WIN7 with .NET 4.0 installed but the app crashes and the errors are System.IO.FileLoadException for mscorlib.dll and PresentationFramework.dll
Does anyone know how to fix it?
More info
I have tried also:
to build with vs2012 but I cannot use vs2010 because I am using async from BCL package
to create new solution with new projects to target from the start 4.0 framework.
I guess the problem is try to run a .NET 4.5 in WIndows 7, which per default utilizes .NET 4.0.
Choose: or to install .NET 4.5 in WIndows 7 (I don't know if it's possible) or downgrade your project to NET 4.
For anyone out there that may have the same problem, be sure that you have installed the latest update for .NET framework, it worked after I have installed the update kb2468871

Building a VS2008 .NET 3.0 solution without installing .NET 3.5 on build server

I am developing using 3.0 and VS 2008.
The problem is my build server does not have 3.5 installed and therefore I cant build the solution as MSBuild for 2.0 will not support the VS 2008 solution file.
There is no easy answer to this besides downgrading to VS 2005.
Any ideas folks?
VS2008 supports C# 3 - you may be using C# 3-specific features while still targeting .NET 2.0.
Is there a strong reason why you can't install .NET 3.5 on the build server? That would be my preferred solution, rather than regressing the version of VS you use.
You could probably automate downgrading the solution/project files - if you're not doing anything complicated, it'll just be a matter of changing version numbers - but it's not great to have the build server using a different compiler to the developers, IMO.
Since you have VS2008 projects and solutions you will need to install .NET 3.5 on you build server. Since you can still target .NET 3.0 or .NET 3.5 having .NET 3.5 installed on your build machine should not have any impact on the target environment.
Is it not possible to include the different versions without 'installing' them? In the repository can you add versioned .NET and point the build script to the version(I'm thinking like a submodule in Git) you want for that project? So instead of installing .NET 3.0, 3.5, 4.0, etc include the libraries?

Categories

Resources