Спасибо, что нашли время для прочтения этого. Я создал консольное приложение в. NET стандарт 2.0 с пакетами NuGet ниже
![NuGet packages](https://i.stack.imgur.com/JWg5o.png)
И я добавил файл Program.cs
using System;
using Microsoft.Owin.Hosting;
namespace ClassLibrary1
{
class Program
{
static void Main()
{
string baseAddress = "http://localhost:9000/";
// Start OWIN host
using (WebApp.Start<Startup>(url: baseAddress))
{
}
}
}
}
и Startup.cs
using Owin; using System.Web.Http;
namespace ClassLibrary1 {
class Startup
{
public void Configuration(IAppBuilder appBuilder)
{
// Configure Web API for self-host.
HttpConfiguration config = new HttpConfiguration();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
appBuilder.UseWebApi(config);
}
} }
При запуске приложения появляется ошибка
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Owin.Hosting, Version=2.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
at ClassLibrary1.Program.Main()
Согласно моему понимание "Mirosoft.Owin" не поддерживается стандартом. NET, есть ли альтернатива этому? Заранее благодарим за помощь.