1
votes

I am trying to use Microsoft.AspNet.Mvc in my Universal Windows Platform (UWP) Application, but can't add the nuGet packages.

The Error says:

Some packages are not compatible with UAP,Version=v10.0 (win10-x64-aot).

Package restore failed for 'Temp1.WinUniversal'.

Package restore failed. Rolling back package changes for 'Temp1.WinUniversal'

Does anyone know how I can use MVC in in a UWP Application? maybe any other libiry?

2
Why would you want to use an ASP.NET MVC library in a UWP application? What do you want from it? - Lloyd
You may want to try ASP.NET 5. Since it's based on .NET Core, there is a possibility it could work. I wouldn't bet on it though - Kevin Gosse
@Lloyd Why should I not use an ASP.Net MVC library in a UWP application? I am new in MVC and just want to develop a clean MVC structure in my UWP Application. What else would you recommend? - SPI
If you want to develop clear structure use MVVM instead. It is something like MVC, but it is designed for non-web apps and xaml... - Alamakanambra

2 Answers

2
votes

You're confusing the pattern MVC with the implementation of MVC for web pages/services on ASP.NET.

They're not the same. You can of course use the pattern MVC in UWP but not ASP.NET MVC. That makes no sense.

However for most desktop applications I think MVVM makes more sense, in which case you should use something like Prism.

2
votes

ASP.Net.MVC runs on top of ASP.Net which runs on top of IIS (or other web servers) to host web pages.
Universal Windows Platform (UWP) is not IIS. It is a desktop platform for making desktop apps.