Does MEF support UWP projects? - asp.net

i have been searching on whether UWP projects can be implemented with Managed Extensibility Framework.
On the GitHub depository
of Prism, it says
MEF is supported with WPF for compatibility with previous versions.
It will not be added to Windows 10 UWP or Xamarin Forms.
(It is for Prism.Mef. But, can it not be for MEF generally?)
on Microsoft Developer Network it is said:
MEF is an integral part of the .NET Framework 4, and is available wherever the .NET Framework is used. You can use MEF in your client applications, whether they use Windows Forms, WPF, or any other technology, or in server applications that use ASP.NET.
Is UWP included in "any other technology" part or with the "in server applications that use ASP.NET" part?
I know .NET Core is used for UWP applications, but that ASP.NET part confuses me.
Briefly,is it possible to write UWP applications with MEF? Answers with sources will be appreciated. Thanks.

It is for Prism.Mef. But, can it not be for MEF generally?
For Prism.Mef only
Is UWP included in "any other technology" part or with the "in server applications that use ASP.NET" part?
UWP is included in "any other technology" part
Briefly,is it possible to write UWP applications with MEF?
Yes, by using the Microsoft.Composition NuGet package, we can easily integrate MEF in UWP app.
Here is an article for Windows Store app(8.1), it is similar with UWP app.
And this is a UWP MEF sample: Link

Related

Can a console app make use of UWP assemblies?

Can a .NET Core console app make use of classes in UWP assemblies?
I am only interested in those that do not involve visual elements.
No, a .NET Core app cannot directly reference an assembly that targets the Universal Windows Platform (UWP, uap10.0) if that's what you are asking.
So if you for example have a class library that was created using the Class Library (Universal Windows) template in Visual Studio, this project is not compatible with any other platform than UWP and cannot be referenced from a .NET Core app/project.
If you need to share code between UWP and other platforms, such as .NET Core, your class library should target .NET Standard instead of UWP.

Project compatibility between .Net Standard and .Net Core

I got lost very quickly in all the moves from .Net Framework to .Net Standard to .Net Core. Could someone please just tell me what I need to do to get my projects to work together?
Here's the situation: I've got a simple web service written in ASP.Net that contains a set of classes built by Entity Framework from an existing database using a "scaffold" command. The web service can respond to a request for a list of coils from a database. The list is delivered as a JSON-serialized string.
I have a simple mobile app developed in Xamarin. I want it to accept the JSON string and deserialize it into a list of Coil objects. To do that, I need to add a reference to the web service project. But when I try to do that, I get complaints that the targets of the two projects are not compatible.
The choices for target frameworks for the web service are .Net 5.0 and .Net Core 1.0 through 3.1. The choices for target frameworks for the Xamarin app are .Net Standard 1.0 through 2.1. I have been unable to find a combination of these choices that works. What choices should I use that would enable me to add a reference to the web service project to the Xamarin project?
Or should I split the Entity Framework-generated classes out into a separate library? That would probably be a better project structure anyway. In that case, I'd have three projects. The target framework chosen for the library would have to be compatible with frameworks chosen for the web service and the Xamarin app, but the framework for the web service would no longer have to be compatible with the Xamarin app's framework.
Or perhaps I should rebuild all of these from scratch. These are all trivial projects, done mainly for education, although the Xamarin app might be useful in the real world. Recreating them would be easy. Again, if I did this, what targets should I use?
All development has been done in Visual Studio 2019.

Is UWP/Xamarin ready for enterprise applications?

Is UWP or Xamarin is usable for enterprise applications like CRM, ERP, etc...
Is the any sample on market, or there are any patterns?
These platform are firstly mobile platforms, but they had a excellent support, a lot of graphically possibility and very modern look and feel. These platform are designed for mobile application in first line, but they are ready for enterprice applications?
Of course the are lot of extension in built control (DataGrid, Charts) which makes possible to create enterprise application. But I did not find any. Is there and problem or drawback of this platforms?
Thank you
Is UWP/Xamarin ready for enterprise applications?
The answer is yes. Xamarin UWP applies not only to mobile platforms but also to desktop platforms(Windows 10). You could also run it in the desktop client. This benefits from the native universal window platform.
For pattern, there many pattern you could select such as publish-subscribe MVVM etc. For more you could refer Enterprise Application Patterns using Xamarin.Forms.
For enterprise publish, you could think of Xamarin UWP application as UWP application, and Distribute LOB apps to enterprises document has described the details of publish process.
And this blog describe the possibility of Xamarin.Form enterprise application that you could refer.

Can we compile an asp.net 5 application by .net native?

The role of .net native in .net ecosystem is confusing for me. I heard it is just for universal windows applications, but also heard that it is part of CoreFX. I think having the option to compile to .net native can have many advantages (including performance).
Is it possible to compile my asp.net application (specially asp.net 5) to .net native?
No, you cannot. Right now, .NET Native is not for ASP.NET. I believe it's only for Universal Windows Applications. That doesn't mean that one day it won't be available, but right now it's not planned.
See related GitHub issue where ASP.NET team confirms this.
Edit 11/27/2015
Since this was posted, Microsoft has made further announcements regarding .NET Native and .NET Core. I suggest you check out Scott Hanselman's part of the keynote from the Microsoft Connect 2015 event. At the 11:22 minute mark of this excerpt video Scott shows compiling an .NET app to native code and then running it. He says it's "future work" so it appears it's not quite ready yet (I believe one of the Q&A videos from the event explained that it's in one of the dev branches on GitHub, but I'm too lazy to rewatch all the videos for you at the moment). It was unclear if this is only working for console apps at the moment or if it will run ASP.NET.
As Thomas says in comments, this should be possible once LLILC is out. It targets .NET Core which is what ASP.NET 5 runs on. I am not sure if the resulting runtime can be called .NET Native per say but LLILC do has plans to natively compile IL (e.g. output by Roslyn) ahead-of-time.
Another option is ASP.NET running on CoreRT by using RyuJIT as AOT compiler. This looks closer to reality today than LLILC. Have seen some experiments in compiling ASP.NET project on CoreRT but nothing that actually works.
[.NET Native makes use of UTC compiler which compiles to run on some C++ runtime (MRT - either minimal runtime or managed runtime, cant remember, also known as Native runtime). Currently the .NET Native UWP apps are windows specific. Though .NET Native and UWP are advertised under .NET Core, this could be misleading as only in debug mode UWP targets CoreCLR, in release mode it targets native runtime which is Windows specific. LLILC/CoreRT should change that.]

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