How to Target Mono Framework from Vs2015

How to target Mono framework from VS2015?

There was some Mono product/Mono for VS that integrates Mono into VS, but now there is none.

You should target .NET Core 5 in this case, as it is going to be the ultimate solution.

Mono does still provide some support for ASP.NET 4.* projects, but it would be difficult to assert compatibility as you need to deploy to Mono on Linux to verify. Even in those cases your project should target full .NET Framework just like what you do in the past. There is no Mono specific profile to target.

How to target .Net Core from Visual Studio?

Had the same problem.
My mistake was that I chose the template for
Windows -> Console Application instead of
Web -> Console Application
when I created the new project. From your screenshot it looks like you did the same.

Depends on what you need. In my case I found that in the latest update for VS 2015 there's the option of Class Library (Portable) more suitable.

A useful add-on to VS 2013 and 2015 is .NET Portability Analyzer to check your code:
https://visualstudiogallery.msdn.microsoft.com/1177943e-cfb7-4822-a8a6-e56c7905292b?SRC=VSIDE

How to get MonoDevelop to target .NET 2.0 framework with C# 4.0 compiler?

The 2.0 C# compilers (mcs/gmcs) that comes with the latest stable Mono version (2.10.9) support default function parameters. I just created a new console project, changed the target framework to 2.0 and compiled default function parameters successfully.

Targeting Runtime for New MVC6 Project in VS 2015

That documentation where you can select the platform is from a previous beta or preview version of ASP.NET 5 so not valid anyone.

Your project.json looks correct.

DNX is an execution environment that can run on various underlying .NET frameworks, including .NET framework 4.5.1,4.5.2 or the latest .NET Framework 4.6.

.NET Core 5 is not .NET Framework 5 but is a modular runtime and library implementation that includes a subset of the .NET Framework 4.X. So you can call it mini .NET 4X. It is not the latest version of .NET framework for Windows. The latest version is .NET Framework 4.6

If you leave your project.json by default as

"frameworks": {
"dnx451": { },
"dnxcore50": { }
},

then when you publish your project you'll then be able to publish to either .NET Core or .NET Framework.

Sample Image

clr-win = .NET Framework windows

core-clr-win = .NET Core

if you do not wish to create cross platform you can edit your project.json to

"frameworks": {
"dnx451": { },
},

and you'll not be able to see the Target DNC Version of .NET Core as a choice when you publish your site.

If you need to use a later .net version feature or if you you wish to include and reference a class library which itself targets a later .net framework version to your project you would need to change your project.json to target the same or later .net framework version e.g. dnx452 or dnx46

e.g.

 "frameworks": {
"dnx46": { },
},

As soon as you save the project.json file your project will automatically update itself. You can view the progress in the output window.

How to switch between target frameworks for .NET Core projects in Visual Studio

At the top of your editor should be the navigation bar. Left in the navigation bar is a dropdown menu that lets you select the context.

If the navigation bar is hidden, you can enable it by going into Tools > Options > Text Editor > C# and check the navigation bar checkbox.

Mono / XBuild Invariant Language (Invariant Culture) vs. VS2015 MSBuild's Neutral Language

Don't expect intricate xbuild bugfixes anytime soon, as MSBuild from Microsoft has already been opensourced, and the Xamarin team has already done some work to make it crossplatform (e.g. it's already shipped inside Mono's installer for Mac).

It's only a matter of time until debian developers (or contributors, like you?) package it (and xbuild becomes deprecated). In the meantime, you could build it yourself and try it out.

VS Code + Develop(Linux) + Target(.net Framework) + Host(Windows)

There are 2 scenarios: ASP.Net Core with .Net framework and ASP.Net Core with .Net Core. You can't develop asp.net core with .net framework on linux, so probably your application's target is "netcoreapp2.0" (suposed you downloaded the latest version). It's ok you deploy your app on windows server just using .net core runtime 2.0.

your command should be

dotnet publish -c Release -f netcoreapp2.0

You can deploy Framework-dependent or self-contained version. See (https://learn.microsoft.com/en-us/dotnet/core/deploying/index).

You also need Asp.Net Core Module on windows with IIS Integration.
https://learn.microsoft.com/en-us/aspnet/core/publishing/iis?tabs=aspnetcore2x

When publishing self-contained you don't need .net core to be installed on the server.

Is it possible to remotely debug a Mono console app from Visual Studio?

It seems it is not possible with free software. I can use Visual Studio with MonoRemoteDebugger and if I have doubts about code compatibility, I can build the project in Xamarin which permits targeting Mono.



Related Topics



Leave a reply



Submit