Frage

I'm trying to self-host some static files on my C# app using Microsoft Owin. It works perfectly well in both IE (for once...) and Firefox, but Chrome doesn't, it's like it's not even trying to connect (I can't see any traffic in Chrome's dev tools).

The problem, of course, is I specifically need it to work on Chrome.

Owin seems a mature project, and I can't believe I'm the only one having this problem, yet I can't find anyone else having the same so I must do something wrong.

This is the code:

const string url = "http://localhost:6667/";

var fileSystem = new PhysicalFileSystem(webSiteFolder.FullName);

var options = new FileServerOptions
{
    EnableDirectoryBrowsing = true,
    FileSystem = fileSystem,
};

_server = WebApp.Start(url, builder =>
{
    builder.UseFileServer(options);
});

Console.WriteLine("Listening at " + url);

Any clue?

Thanks!

War es hilfreich?

Lösung

use another port, for example 5000

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top