Why can't I run an ASP. NET 5 program on my Mac with K Web

Source: Internet
Author: User
Tags hosting

The commands for K Web are as follows:

"Web": "Microsoft.AspNet.Hosting--server Microsoft.AspNet.Server.WebListener--server.urls http://localhost:8001"

Where Microsoft.AspNet.Hosting is Owin Host, with K Kestrel is the same. Microsoft.AspNet.Server.WebListener is Owin Server.

To run K Web, you need to add a reference to Project.json:

"Microsoft.Framework.DependencyInjection": "1.0.0-beta2", "MICROSOFT.FRAMEWORK.DEPENDENCYINJECTION.AUTOFAC": " 1.0.0-beta3-10754 "

Otherwise, an error will occur:

Missing Method Microsoft.framework.dependencyinjection.servicecollectionextensions::addcontextaccessor

The final error that occurs with K Web is:

System.DllNotFoundException:httpapi.dll

So what's the reason?

Microsoft.AspNet.Server.WebListener although a. NET managed program, is called by the Microsoft.AspNet.Server.WebListener.ServerFactory.Initialize. But AspNet.Server.WebListener called in Microsoft.AspNet.Server.WebListener.ServerFactory.Initialize . Microsoft.Net.Http.Server.WebListener , and an unmanaged httpapi.dll is used in the Http.Server.WebListener constructor:

// Microsoft.Net.Http.Server.WebListener  Public Weblistener (Iloggerfactory factory) {    if (!  UnsafeNclNativeMethods.HttpApi.Supported)    {        thrownew  PlatformNotSupportedException ();    }}

The problem is here.

Why can't I run an ASP. NET 5 program on my Mac with K Web

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.