Will .Net MAUI be comptabile with .NET Standard 2.0? - c#

We currently just started to write class libraries in .NET Standard so we can use this for WPF, Winforms and .Net Core with Ubuntu Server (but then without GUI). .Net 5 does not support Winforms or WPF for our .NET 4.6.x applications.
My question is, will .NET MAUI be compatible with .NET Standard 2.0 class libraries?
When I look at the .NET Standard website its says compatibility with .NET 6.0, but I can't find if that also the .NET MAUI framework.
https://dotnet.microsoft.com/platform/dotnet-standard#versions

My question is, will .NET MAUI be compatible with .NET Standard 2.0 class libraries?
Yes, because, as it was mentioned in comments, .NET MAUI is just a library. You don't compile with MAUI, but rather with .NET 6.
All .NET Core versions starting from 2.0 can reference .NET Standard 2.0 libraries, and since .NET 6 is just a rename of what would be .NET Core 5, that is certainly possible.
The problem, however, is here:
We currently just started to write class libraries in .NET Standard so we can use this for WPF, Winforms and .Net Core with Ubuntu Server. .Net 5 does not support Winforms or WPF.
You can't use WPF nor Winforms in Linux/MacOS. You also can't use .NET MAUI in Linux as there is (currently) no target for that environment. The desktop environments supported are the same as for Xamarin: Windows and MacOS.
Notice that it was mentioned here that support for Linux is being considered for .NET 7, which should be released in around a year.

Related

How can I use console app (.NET Core) on Visual Studio 2022

I can't use console app with .NET Core. I tried download every workload, but I cannot reach it. Everyone tells me to use framework but my course teacher is using console app in .NET Core and I don't want to move forward without solving the problem I'm facing.
Thank you for helping.
ss
Long story short:
For the longest time there existed only .NET Framework (and the non-MS implementation of the framework: Mono). .NET Core was released in 2016 as Microsoft's cross-platform .NET solution. Nowadays .NET Framework is being phased out, and .NET Core going forwards is called simply .NET (.NET 5, .NET 6 and so on).
What you see in your screenshot is the correct project template for .NET Core (.NET) workloads.
See the note at the bottom of this page:
Beginning with .NET 5.0, Microsoft .NET Core has been rebranded as .NET.
You are pointing to the correct template. After.Net Core 3.X versions. >=.Net 5 are .net core only.
You just proceed with creating a new project and then you can select the version of your choice.

Upgrade from .NET 4.0 to .NET 4.7

We have some legacy apps (ASP.NET) that have been targeting the .NET 4 framework, which is out of support. Looking at some articles https://learn.microsoft.com/en-us/lifecycle/faq/dotnet-framework, it basically says we don't need to recompile our apps to target the newer version of the framework.
How do I make sure that our apps are running with the latest (.NET 4.7) framework?
Thanks.

.net core app target .net framework 4.5.2 on Linux

I wanted to understand the dot net core support a bit more.
My basic understanding was that if I wanted to run a .net app on Linux then it needs to be built .net core and targeted netcoreapp1.0 framework to guarantee this.
1) I assume the above assumption is correct?
2) When I was reading various articles online, such as this one about referencing exiting .net framework project within a .net core application (https://www.hanselman.com/blog/HowToReferenceAnExistingNETFrameworkProjectInAnASPNETCore10WebApp.aspx)
If I did this, presumably the app would only run on Windows and not Linux?
3) In the following article:
https://blogs.msdn.microsoft.com/cesardelatorre/2016/06/28/running-net-core-apps-on-multiple-frameworks-and-what-the-target-framework-monikers-tfms-are-about/
In context to running with .net run 4.5.2 option (
dotnet run -f NET452), it's mentioned:
If this app were running on the .NET Core Platform, let’s say on a Linux box or a Mac, this code won’t be executed, but the app would
still be running on Linux or MacOS.
What's the distinction between running and not executing? If my initial understanding was correct, then by running with .net 4.5.2 option on Linux I wouldn't expect the app not to run at all.
Appreciate a few questions there but really wanted to understand .net core a bit more.
There is a difference between .NET Core and ASP.NET Core and the articles you mentioned are about running ASP.NET Core "apps" on .NET Framework. Let my try to clarify this using a few declarative statements:
.NET Core is the cross-platform runtime.
ASP.NET Core is a set of libraries that until version 1.1.* can run
on both .NET Framework and .NET Core.
This means you can create a .NET Framework application (=> e.g.
net452) and use ASP.NET Corein this application.
The CLI tooling works for both projects targeting netcoreapp* and
net* - but net* currently only works on windows.
This means that for netcoreapp1.*, you cannot reference arbitrary libraries that have been built for .NET Framework. If you change the target framework to say net452, you are no longer building a .net core application, but a .net framework application.
For ASP.NET Core 2.0 this is going to change. Again a few statements:
ASP.NET Core 2.0 is still a set of libraries but they can only be used on .NET Core 2.0 and not on .NET Framework
Do note that this is still under discussion at the time of writing: https://github.com/aspnet/Home/issues/2022
.NET Core 2.0 is able to freely reference libraries that have been built for .NET Framework up to version 4.6.1
However, some libraries may fail at run time if they try to use API methods that aren't available on .NET Core

Can UWP run in .NET?

When I create new UWP project it automatically references .NET Core. Is it possible to run it on .NET? Why it needs .NET Core? I can't find any valuable information about this...
It needs .NET Core because it is built on .NET Core, much like WPF is built on the .NET framework.
So no, you cannot change it to run on the standard .NET framework any more than you can make WPF run on .NET Core.
The .NET Core Framework is a new version of .NET for modern device and cloud workloads. It’s a general-purpose and modular implementation of the Microsoft .NET Framework that can be ported and used in many different environments for a variety of workloads.
and No, you cannot run UWP project on .Net
althousg if you install previous version of VS then you can run it on .NET

Porting a Prism-based WPF application to .NET Core

We have a Prism-based WPF application with over 10 man years of development invested in it.
We are moving big chunks of it into web browser control hosted modules to make it platform independent in the future.
There seems to be no UI framework to take over XAML in .NET Core.
Would it be possible to port it into .NET Core in the future?
It's looking like WPF or at the very least XAML will become part of .NET Standard 2.0 roughly Q1 2017 / Q2 2017
Immo Landwerth - Program manager on .NET at Microsoft
https://twitter.com/MikeEEE76/status/776769805722521600
Bug - Port System.Xaml to .NET Core #5766
https://github.com/dotnet/corefx/issues/5766
.NET Core Roadmap
https://blogs.msdn.microsoft.com/dotnet/2016/07/15/net-core-roadmap/
I am updating this answer as new .NET Core 3 and .NET Framework 4.8 are releasing with support of Windows Desktop Applications.
There is an update regarding .NET Core 3 and .NET Framework 4.8:
Update on .NET Core 3.0 and .NET Framework 4.8
Announcement of .NET 5 as ".NET Core vNext", the next release after .NET Core 3.0. In this announcement, Microsoft shows .NET 5 as a unifying platform for desktop, Web, cloud, mobile, gaming, IoT, and AI applications. It also shows explicit integration with all Visual Studio editions and with the command line interface (CLI). The goal of the new .NET version is to produce a single .NET runtime and framework, cross-platform, integrating the best features of .NET Core, .NET Framework, Xamarin, and Mono (the original cross-platform implementation of .NET). .NET 5 also features Java interoperability on all platforms and interoperability with Objective-C and Swift on multiple operating systems.
Image source: https://devblogs.microsoft.com/dotnet/introducing-net-5/
Still, it is clear that all future investments in .NET will be related with .NET Core, and that .NET 5 is the next step forward with .NET Core. All related development will continue to be open-source and community-oriented. The production release of .NET Core is scheduled to later this year, in September, and .NET 5 is expected on late 2020. The current .NET Core roadmap is available here.
Image source: https://devblogs.microsoft.com/dotnet/introducing-net-5/

Categories