Frameworks which provide Behavior<T> in .NET Core 3 / WPF - .net-core-3.0

The Behavior class from System.Windows.Interactivity is used in an application I'm working on and this is being ported to .NET Core 3.0 / WPF Desktop.
There doesn't seem to be an equivalent for this class, as System.Windows.Interactivity is built against the .NET Framework.
Are there any alternatives out there?

This answer describes in details what needs to be done: https://stackoverflow.com/a/56240223/532575 .
In short, the Microsoft.Xaml.Behaviors.Wpf NuGet package is a replacement for Microsoft.Expression.Interactions and System.Windows.Interactivity.

You can use the .NET Framework version of the WPF Behaviors in your .NET Core 3 project as is - it is 100% compatible (the build warning is ignorable).

I realised my question was a bit thick as these packages are Open Source...
So I've solved the problem by cloning microsoft/XamlBehaviorsWpf and including the source for Behavior and dependencies in my .NET Core 3 application.

Related

Is OxyPlot.Wpf compatible with .NET Core?

Does OxyPlot.Wpf work on .NET Core?
My application uses .NET Framework 4.8. I am considering switching to .NET Core 3.1.5 which was released in 2020 June.
Note OxyPlot has an assembly called OxyPlot.Core but it has nothing to do with .NET Core from what information I have gathered. OxyPlot.Core is "the core library... you also need to add a platform-specific OxyPlot package". This makes it seem that OxyPlot.Wpf depends upon OxyPlot.Core and in fact if you try to uninstall OxyPlot.Core the error will be "unable to uninstall OxyPlot.Core.2.0.0 because OxyPlot.Wpf.2.0.0 depends on it". The online documentation does not seem to tell you this but fortunately NuGet will prevent the uninstall.
This means OxyPlot.Core is the core of OxyPlot and its existence does not necessarily tell you anything explicit about .NET compatibility.
I'd say yes it is compatible. Based on the nuget link https://www.nuget.org/packages/OxyPlot.Wpf
Think you Will find OxyPlot works fine with Wpf .NET Core .. but I cannot say the same for a Winforms .NET Core project I have; at the present time I am having (the usual) enormous difficulty in making it work

Installing MVC on asp.net Core in visual Studio 2015

I created an empty ASP.NET 5 to work with .NET Core. I am trying to add MVC package to the application but I am receiving an Error that the Versions are not compatible, although I tried lots of MVC versions.
Anyone has an idea about the problem? thank you!
You need Nuget packages in the Microsoft.AspNetCore.Mvc namespace. You're currently trying to install Microsoft.AspNet.Mvc 5.2.3, which is the traditional MVC package and only works with full .NET.
If you're working with .NET Core you should be using Microsoft.AspNetCore.* packages. (Microsoft.AspNet.* packages target the full .NET framework.)
Your screenshot shows a dependency on DNX. You do realize that's a pre-release technology? I don't mean to be rude but I'm curious as to why you would be targeting the pre-release framework rather than RTM (which has been available for several months).
If you do want to work with the prerelease bits, you may need to tweak your NuGet feeds to be able to see the appropriate .NET Core packages (I definitely had to do this when working with .NET Core betas).

which asp.net mvc version is compatible with .net framework 4.6

I am new to ASP.NET MVC applications and I'm building a web project in Visual Studio 2015. My project targets .Net framework 4.6. I want to know which version of ASP.NET MVC is installed with this version of the framework. I have browsed a lot and also looked for answers at the ASP.NET official website, but could not find the answer.
A relevant, but not specific, answer was found at:
https://softwareengineering.stackexchange.com/questions/157717/what-is-dependency-of-asp-net-mvc-on-net-framework-and-how-to-use-it-with-net
It would be great if someone could list the versions of ASP.NET MVC alongside the versions of the .Net framework they depend upon.
Try using Visual Studio 2017, because it is not dependent on the OS you are using or targeting.
As for your question, which version of MVC are you currently using, and what are the requirements for the project?
If you're building a website that uses Entity Framework or APIs, then I recommend using framework 4.6 and MVC 5 or Core.
According to MSDN:
Runtime Changes Runtime changes affect all apps that are running under
the .NET Framework 4.6 and that use a particular feature. Retargeting
Changes Retargeting changes affect apps that are recompiled to target
the .NET Framework 4.5, 4.5.1, or 4.5.2, or 4.6. They include: Changes
in the design-time environment. For example, build tools may emit
warnings when previously they did not. Changes in the runtime
environment. These affect only apps that specifically target the .NET
Framework 4.6. Apps that target previous versions of the .NET
Framework behave as they did when running under those versions.
I hope this helps you.

What's the difference between ASP.NET 5, .NET Core, and ASP.NET Core 5? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I'm confused on the distinction between these terms:
ASP.NET 5 (now renamed ASP.NET Core and released as 1.0, not 5.0)
ASP.NET Core 5
.NET Core
Can anyone briefly explain it?
ASP.NET 5 (now ASP.NET Core 1.0)
Is the next generation of ASP.NET that provides a familiar and modern framework for web and cloud scenarios. It includes the next versions of ASP.NET MVC, Web API, Web Pages and SignalR. It is a high-performance and modular design, and supports full side by side to make it seamless to migrate from on premise to the cloud. These products are actively developed by the ASP.NET team in collaboration with a community of open source developers. Together we are dedicated to creating the best possible platform for web development.
Update: It has been renamed from ASP.NET 5 to ASP.Net Core 1.0.
.NET Core:
.NET Core is the small optimized runtime that is the basis of ASP.NET Core. It currently runs on Windows, Linux, and Mac. It is a high-performance and modular design, and supports having several applications on a web server each one with its own copy of the .NET Core runtime, enabling a full side by side experience, and that will make it easy to adopt new .NET Core versions without affecting other apps, and this makes .NET Core architecture a leap forward from the current classic .NET 4.6. These products are actively developed by the .NET team and in collaboration with a community of open source developers. Together we are dedicated to improving and extending the .NET platform with new features and for new scenarios.
.NET Core has two major components. It includes a small runtime that is built from the same codebase as the .NET Framework CLR. The .NET Core runtime includes the same GC and JIT (RyuJIT), but doesn’t include features like Application Domains or Code Access Security. The runtime is delivered on NuGet, via the Microsoft.CoreCLR package.
.NET Core also includes the base class libraries. These libraries are largely the same code as the .NET Framework class libraries, but have been factored (removal of dependencies) to enable us to ship a smaller set of libraries. These libraries are shipped as System.* NuGet packages on NuGet.org.
For more information, see Introducing .NET Core
ASP.NET 5 is a new platform based on DNX (.NET Execution Environment). DNX is on duty for loading CLR. There're two kind of DNX now: for Full .NET CLR (from .NET Framework) and for CoreCLR. CoreCLR is a new cross-platform light CLR (runs on Win/Linux/Mac).
ASP.NET 5 works seamlessly on CLR/CoreCLR as DNX abstracts it from runtime being used.
IL assemblies build for old .NET still be used with new CoreCLR and DNX. So ASP.NET 5 functionality is a bunch of nuget packages.
Strictly speaking there're no such things as "asp.net core 5" and ".net core" now (as CLR != .NET). There's "ASP.NET 5 running on CoreCLR".
IMO it's better to consider "ASP.NET 5" as ".NET 5".
There is no ASP.net Core 5 yet. In fact, Microsoft decided to change the .net 5 (The version after 4.6) to a brand new name : .net Core
So the version released on June 2016 is actually .net Core 1.0
The reason why they gave it a new name is the very fundamental change they've made in it.
These fundamental changes include :
Cross platform: It works on Windows/Linux/Mac as opposed to the previous versions working only on Windows/IIS
It's fully open source now and you can see every bit of its code in GitHub.
Its performance (especially in ASP.net) is way better than the previous versions, as you can easily customize your request pipeline according to what you need (through middlewares).If you are familiar with nodejs and ExpressJs framework it's so similar to ExpressJs. In some cases it performs better than NodeJs. Have a look into this benchmark.
It's designed with a modern mindset of app development, for highly distributed cloud applications, microservices and containers (docker)
ASP.NET Core is the next version of ASP.NET MVC 5, Yes, the version number is confusing! It has gone through a few name changes. It started as ASP.NET vNext, then changed to ASP.NET 5, next was renamed to ASP.NET MVC 6 and eventually became ASP.NET Core 1.0.
The main difference between ASP.NET and ASP.NET Core are
Platform Independent Features, ASP.NET Core provides hosting in multiple platform (Win / Linux / Mac OS) hosting (Cross platform).
Introduced new lighter version of CLR and assemblies with non-dependent frameworks.
Frameworks are a complete rewrite (removal of dependencies with DI) and Its Open source Project.
Project default project template is updated with Type scripts insted of JQuery.
Improved new security features and completely decoupling for all its dependent framework.
Updated project template with angular and json based configuration & enhanced packages support with node modules.
Supports for Visual Studio IDE ( 2015 v3 + 2017 and above) & VS Code IDE.
If you are new to this, Please refer Here
By the way there is also a Mono runtime as an alternative to CoreCLR in the linux apt and Docker package. Mono is still the default when it's up to installing DNX. The whole thing about the "Core" is that it's a cross platform .net framework and at some point hosting an ASP.NET 5 app will not make use of IIS, Apache, Mono etc., but the DNX and Libuv.
.NET Core 1.0 is not the next version of .NET 4.6.2 (Full .NET Framework). If it is the next version it should have more features than the previous version. But according to Microsoft .NET Core 1.0 doesn't have some of the features .NET 4.6 got. That's why they named it as .NET Core 1.0 instead of .NET 5.
In ASP.NET Core 1.0 they are using .NET Core 1.0 as reference. That means we don't need to install .NET framework to run our ASP.NET Core 1.0 application.
You can find more updated information here.
ASP.NET Core i.e 1.0/2.0...
ASP.NET Core is an open-source, cross-platform framework for building modern, cloud-based web apps on Windows, macOS, or Linux.
ASP.NET i.e ...4.5/4.6
ASP.NET is a mature framework that provides all the services needed to build enterprise-grade, server-based web apps on Windows.
There is no such thing as ASP.NET Core 5 and .NET Core.
ASP.NET 5 is same as ASP.NET Core 1.0
Please refer to the link:
https://learn.microsoft.com/en-us/aspnet/core/choose-aspnet-framework?view=aspnetcore-2.0

Class library that can be shared between .NET Framework and .NET Core

I have a big class library written in .NET 4.0 but when I reference it in a Store App that uses .NET Core, it shows an error. And further, Microsoft just released .NET Core for the next version of .NET.
I want to know what type of project will be able to be shared by both .NET 4.6 and .NET Core? Is a class library able to do that?
It seems that the release of .NET Core specialized for Store Apps causes confusion for me.
If you have a PCL (Portable Class Library) that works for Metro apps, it will definitely run on the fully fledged .NET (aka, your normal ASP.NET, WF, WPF applications).
That means that you don't have to do anything, besides porting your existing library to be compatible with the PCL you choose.
There is a new target called dotnet which you can use to target the platforms DNX, UWP and .Net 4.6. Effectively, this libraries are build against .Net Core packaged libraries instead of the libraries of the full .Net Framework.
Read more here: https://oren.codes/2015/07/29/targeting-net-core/ and related posts.

Resources