locked
[UWP]Is it possible to use asp.net core in a universal windows application? RRS feed

  • Question

  • I downloaded the latest RC of asp.net (1.0.0-preview2-003155) and I can use it on my desktop but something like:

            public static void Main(string[] args)
            {
                var host = new WebHostBuilder()
                    .UseKestrel()
                    .UseStartup<Startup>()
                    .Build();
    
    
                host.Run();
            }

    requires:

    using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http;

    And these namespaces do not seem to be available to be added as references to a universal windows application, and editing the JSON file to include the package resulted in a failed nugget package restore.

    I am using VS 2015 community edition with update 3 on Windows 10 anniversary edition.


    • Edited by Jayden Gu Friday, December 2, 2016 6:58 AM title tag
    Thursday, December 1, 2016 10:40 PM

Answers

  • Hi ellipsisware,

    It seems the asp.net core can not be used in UWP. The asp.net and WinRt are not the same application model.

    Also there is an bolg about ASP.NET Core SignalR for Windows 10 UWP App:

    As you may know that currently we can use ASP.NET Core for creating WebAPI, it come to my mind to try SignalR service using ASP.NET Core and with Windows 10 UWP as the client for consuming the SignalR service. This blog is about just that, I divide the project into two, that is the SignalR service server and SignalR client which is inside Windows 10 UWP app. 

    For more info, please refer it in this link: https://www.rizamarhaban.com/2016/09/13/asp-net-core-signalr-for-windows-10-uwp-app/.


    Best Regards,

    Jayden Gu

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by ellipsisware Friday, December 2, 2016 7:04 PM
    Friday, December 2, 2016 1:40 PM

All replies

  • Hi ellipsisware,

    It seems the asp.net core can not be used in UWP. The asp.net and WinRt are not the same application model.

    Also there is an bolg about ASP.NET Core SignalR for Windows 10 UWP App:

    As you may know that currently we can use ASP.NET Core for creating WebAPI, it come to my mind to try SignalR service using ASP.NET Core and with Windows 10 UWP as the client for consuming the SignalR service. This blog is about just that, I divide the project into two, that is the SignalR service server and SignalR client which is inside Windows 10 UWP app. 

    For more info, please refer it in this link: https://www.rizamarhaban.com/2016/09/13/asp-net-core-signalr-for-windows-10-uwp-app/.


    Best Regards,

    Jayden Gu

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by ellipsisware Friday, December 2, 2016 7:04 PM
    Friday, December 2, 2016 1:40 PM
  • Thank you, the link was interesting but it does not help solve my issue - I want a secure server on Windows 10 UWP.

    Asp.net core advertises itself as running on anything -but not apparently on Windows 10 UWP! It is confusing that "Microsoft.AspNet.SignalR" which is not core can run on UWP.

    Friday, December 2, 2016 7:04 PM