I have few C# projects which requires .net framework 4.0 msbuild.exe
"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe" to build the project.
But now i have one c# project which requires .net framework 4.6 msbuild.exe.
So i installed following components:
• Microsoft .NET Framework 4.6
• Microsoft .NET Framework 4.6 Targeting Pack
• Microsoft Build Tools 2015
pointed my msbuild to "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe".
But when i'm installing .net framework 4.6 it upgrades 4.0 so i'm facing issues while building .NET 4.0 Framework apps.
So is it possible to build 4.0 apps with 4.6 msbuild.exe?
The .net framework can only have one installation on each PC for each major version - i.e. 4.*.
The different versions of msbuild are associated with the ms tools version.
The .net 4.6 is a drop in replacement for .net 4.0, so you cannot have both installed, they use the same directory.
You can configure a jenkins slave machine which has the .net 4.0 framework on it, and mark the builds which require .net 4.0 to run on it.
See https://wiki.jenkins-ci.org/display/JENKINS/Step+by+step+guide+to+set+up+master+and+slave+machines
Related
I'm trying to build FluentFTP, which has releases for .NET 2.0, 3.5, 4.0 and .NET Standard. All of the releases build fine within the VS 2017 IDE on Windows 7. However when I try to build using dotnet.exe, it crashes with this error:
"Reference assemblies for framework NETFramework,Version v2.0" were not found...
My build script looks like this:
dotnet --info
dotnet restore -v Minimal
dotnet build -c Release
pause
How do I build this successfully from the console?
It would appear you are missing the .NET 2.0 SDK, here are the links to install it:
x86
https://www.microsoft.com/en-us/download/details.aspx?id=19988
x64
https://www.microsoft.com/en-us/download/details.aspx?id=15354
Per the docs the dotnet build command-line approach is only meant to support .NET Core builds, not .NET Framework builds.
.NET Framework 2.0 isn't supported by any current build system and it also isn't supported by Visual Studio 2017, so I'm surprised it worked correctly. I believe VS2010 was the last version to officially support .NET 2.0 development. .NET Framework builds rely on msbuild (so does dotnet build but with different switches and files).
Visual Studio 2017 Support for .NET Development states that VS2017 supports:
.NET Framework versions 4.7, 4.6.2, 4.6.1, 4.6, 4.5.2, and 3.5
.NET Core 2.0, 1.1, and 1.0.
.NET Native
Mono
Imagine Jane is on Ubuntu and uses VSCode with .NET Core 2.0 SDK to create and push a NuGet package targeting netstandard2.0 to a repo.
Imagine I have a .NET 4.6.1 full framework project - its a Windows Service executable.
Since .NET Standard 2.0 is the common spec in the above and I'm using Visual Studio 2017 Update 3 and latest SDKs and stuff, I reference Jane's .nupkg.
I build and XCOPY my /bin/release to a server VM with just the .NET 4.6.1 Framework installed.
Will it run, or do I need to install anything else on the server?
I have one friend with Windows 7 OS (x64). For this OS .net 4.6.1 is unsupported.
I have on my pc Windows 10 (x64) with install vs community 2015 and here all working fine.
So, when my friend is trying to launch my app he gets request to install .net 4.6.1.
In vs project "Target framework" field is ".NET Framework 4.5.2"
Crutches from Microsoft?
and what can i do for fix that?
From here:
The .NET Framework 4.6 is an in-place upgrade for all of the following versions of the .NET Framework:
.NET Framework 4
.NET Framework 4.5
.NET Framework 4.5.1
.NET Framework 4.5.2
An in-place upgrade means that if you install the .NET Framework 4.6 when any of the above versions of versions of the .NET Framework are installed on your PC, .NET Framework 4.6 setup will upgrade them and you will be left with only the .NET Framework 4.6 installed afterwards. In addition, any attempts to install older versions of the .NET Framework 4 family when the .NET Framework 4.6 is already present will result in .NET Framework setup blocking you from installing because it detects that a newer version is already installed.
The .NET Framework 4.6 is designed to be compatible with all applications created with any version of the .NET Framework from 4 to 4.6, but there are sometimes application compatibility issues that arise, such as an installer that tells the user that they must install the .NET Framework 4.5 even if the .NET Framework 4.6 is already installed. In cases like this, you might need to revert back from the .NET Framework 4.6 to an earlier version of the .NET Framework 4 family. To do that, you must uninstall the .NET Framework 4.6 and then re-install the earlier version of the .NET Framework from the .NET Framework 4 family.
Basically, it is prompting you to install 4.6.1 because it is the highest version that is compatible with your program that is targeting 4.5.2, and the target machine apparently doesn't have any compatible framework (4.5.2 or higher) installed.
Previously the highest .NET framework profile I had installed with Visual Studio 2013 was 4.5x. I then downloaded and ran the offline installer for 4.61, found here:
https://www.microsoft.com/en-us/download/details.aspx?id=49982
After the installation completed successfully (no error reports and nothing in the system event logs), I restarted the system as instructed and reloaded VS2013. However, I still don't see anything higher than 4.5x in the list of available frameworks when I choose New Project. Can anyone tell me how to fix this?
UPDATE: I already had installed the 4.6 pack using the same procedure before installing the 4.61 pack. Neither 4.6 or 4.61 are showing in the framework choice drop-down when creating a new project.
To develop with .NET 4.6, you'll need to install the .NET Framework 4.6 Targeting Pack after installing the 4.6 framework:
The .NET Framework 4.6 Targeting Pack is a package that enables developers to build applications targeting the .NET Framework 4.6 using either Visual Studio 2013, Visual Studio 2012 or third party IDEs. You need to download and install the .NET Framework 4.6 prior to installing the targeting pack.
With .NET 4.6.1, the framework, targeting pack, language pack and intellisense updates are all bundled together in the .NET Framework 4.6.1 Developer Pack.
The Microsoft .NET Framework 4.6.1 Developer Pack is a single package that bundles the .NET Framework 4.6.1, the .NET 4.6.1 Targeting Pack and the .NET 4.6.1 SDK. The corresponding language pack for Dev Pack contains the .NET Framework 4.6.1 language pack, .NET 4.6.1 SDK language pack and the Intellisense files. Developers can use this package to install all the different components for .NET 4.6.1 and build applications targeting the .NET Framework 4.6.1 using either Visual Studio 2015, Visual Studio 2013, Visual Studio 2012 or third party IDEs.
I've been working on a .NET 3.5 C# project using Visual Studio Community 2015, but I had always intended to do most of the development on Linux (Ubuntu Gnome 15.04) using Mono and MonoDevelop.
I'm running the latest stable Mono release (4.0.4) and MonoDevelop (5.9.6), which supports .NET 4.5 and can open the VS created solution file without issue.
Now I've been writing C++ apps on Linux for the best part of a decade, but C# and .NET are completely new to me. So I assumed that if I installed a Mono version that supports .NET 4.5, I would get .NET 3.5 as well because the later version is a superset of the older - much like a C++14 compiler supports C++03.
However this doesn't seem to be the case, as MonoDevelop states (under the Target Framework option for each project):
.NET Framework 4.5.1
Mono / .NET 4.5
Mono / .NET 3.5 (Not installed)
So do I have to install a parallel older version of Mono in order to get .NET 3.5 support, or am I just suffering a configuration problem?
No configuration issue, Mono dropped support for the older frameworks in the 4.x release. If you need to compile against the 3.5 assemblies, then yes, you will need a parallel install.
Dropped Support for Old Frameworks
Reference Assemblies
We no longer build the reference assemblies for the .NET 2.0, .NET 3.5
or .NET 4.0 APIs, we now ship binaries of the reference assemblies
(API contracts, without any actual executable code in them).
Mono will now only build the .NET 4.5 assemblies as well as the
mobile-based profiles.
Note: You can still run assemblies compiled for earlier .NET profiles
on Mono, there’s no need to recompile them (they’ll just run on the
.NET 4.5 assemblies instead).
I had a similar issue (project targeting .NET 4.0, but now only 4.5 is available through mono). My workaround was to create a symlink for 4.0:
On my Fedora 32 machine this was done by
cd /usr/lib/mono
sudo ln -s 4.5 4.0
This is supposed to work because there a (almost) no breaking changes between .NET 4 and 4.5 - YMMV
Finally, Got it to work. I'm using Visual Studio for Mac - https://www.visualstudio.com/vs/visual-studio-mac/
Under Preferences->Projects->.Net Runtimes you can change the Default .Net Runtime. It defaults to Mono 4.8.0.
This is located here on a mac : /Library/Frameworks/Mono.framework/Versions/4.8.0
From here you can download older versions of Mono https://download.mono-project.com/archive/
I downloaded 3.12.1 from https://download.mono-project.com/archive/3.12.1/macos-10-x86/
and copied it into the /Library/Frameworks/Mono.framework/Versions/ folder.
Within VisualStudio you can then add the .net framework and set it as default. My project then compiled.