This project has moved and is read-only. For the latest updates, please go here.

Embedded Resources

Jan 4, 2016 at 8:20 AM
I'm new to Owin and I have an advanced question and I hope it's possible to do that.

I have an web application HTML/JS/CSS and I configured Owin Like This
    var url = "http://localhost:8080";
    var root = args.Length > 0 ? args[0] : ".";
    var fileSystem = new PhysicalFileSystem(root);

    var options = new FileServerOptions();
    options.EnableDirectoryBrowsing = true;
    options.FileSystem = fileSystem;
    options.StaticFileOptions.ContentTypeProvider = new CustomContentTypeProvider();
    options.EnableDefaultFiles = true;

    WebApp.Start(url, builder => builder.UseFileServer(options));
    Console.WriteLine("Listening at " + url);
And sure enough it works when i add my project in a sub folder and navigate to it Like: http://localhost:8080/test/ What I want to do is to move my files from physical directory to embedded resources and make this embedded resources as my project folder / path for owin.

Can I do that ?? and how can I achieve this !!
Jan 4, 2016 at 5:44 PM
Jan 5, 2016 at 4:33 AM

can you Please give me an example cause when i browse it i can only find TestHTTP.AppResources.resources ... how i can Initiate my index.html from this embedded resource

Jan 6, 2016 at 10:20 PM
FileSystem = new EmbeddedResourceFileSystem("TestHTTP.AppResources.resources")
Directory browsing didn't work for some reason, but I could browse to index.html.