Closed martingit closed 10 years ago
Does it work if you copy it into the host project?
sent from my mobile On 19 Dec 2013 09:05, "martingit" notifications@github.com wrote:
I get a 404.0 in IIS 7.5 when trying to load a svg/woff file with EmbeddedResourceVirtualPathProvider. I've added the mimetype in web.config
Png, js, cshtml all work fine.
— Reply to this email directly or view it on GitHubhttps://github.com/mcintyre321/EmbeddedResourceVirtualPathProvider/issues/4 .
Yes, the host project can serve .svg and .woff, but not as embedded resource. I've also added < modules runAllManagedModulesForAllRequests="true"/>, but that didnt work either.
Debug info EmbeddedResourceVirtualPathProvider (svg file): One call to FileExists in Vpp.cs returns true, but GetFile is never called.
png file: Two calls to FileExists (both return true) and one call to GetFile. The file is delivered correctly.
Is this IIS 7.5 config error?
Found the issue. It was in System.WebServer.Handlers in my web.config. I had forgotten to add handlers for the named filetypes. My bad.
They are a PITA
I have problem with the latest ERVPP witth IIS 7.5 (MVC 5-VS 2013). Static file Handlers were added :
< system.webServer>
< handlers>
< add verb="GET,HEAD,POST" path="*.css" name="Static for css" type="System.Web.StaticFileHandler" />
< /handlers>
< staticContent> < remove fileExtension=".css" /> < mimeMap fileExtension=".css" mimeType="text/css" /> < /staticContent>
< /system.webServer>
While it works perfectly in IIS Express, IIS 7.5 deployment does not work with 404 error !
You have any idea ?
Have you tried without < mimeMap fileExtension=".css" mimeType="text/css" /> ?
Yes, I just tried it out and get the same error. I really wonder how MartinGit can make it work.
Put a repo up somewhere with a minimal repro and I will take a look.
I only added these to system.webserver.handlers.config < handlers> < add verb="GET" path=".js" name="Static for js" type="System.Web.StaticFileHandler" /> < add verb="GET" path=".css" name="Static for css" type="System.Web.StaticFileHandler" /> < add verb="GET" path=".png" name="Static for png" type="System.Web.StaticFileHandler" /> < add verb="GET" path=".jpg" name="Static for jpg" type="System.Web.StaticFileHandler" /> < add verb="GET" path=".svg" name="Static for svg" type="System.Web.StaticFileHandler" /> < add verb="GET" path=".svgz" name="Static for svgz" type="System.Web.StaticFileHandler" /> < add verb="GET" path=".eot" name="Static for eot" type="System.Web.StaticFileHandler" /> < add verb="GET" path=".woff" name="Static for woff" type="System.Web.StaticFileHandler" /> < add verb="GET" path="*.ttf" name="Static for ttf" type="System.Web.StaticFileHandler" /> </ handlers>
Well, I tried to create a blank MVC project with ERVPP, it works. Must be some problem with my project setting that affect ERVPP code
I get a 404.0 in IIS 7.5 when trying to load a svg/woff file with EmbeddedResourceVirtualPathProvider. I've added the mimetype in web.config < system.webServer> < staticConfent > < remove fileExtension=".svg" /> < mimeMap fileExtension=".svg" mimeType="image/svg+xml" /> < remove fileExtension=".svgz" /> < mimeMap fileExtension=".svgz" mimeType="image/svg+xml" /> < remove fileExtension=".woff" /> < mimeMap fileExtension=".woff" mimeType="application/font-woff" /> </ staticContent> </ system.webServer> Png, js, cshtml all work fine.