0

I'm working on an ASP.NET/MVC/Razor web site. I need to server up files with a "pdb" extension. The *.pdb files are plain ASCII text files. I tried adding the following declaration to my web.config file:

<system.webServer>
    <staticContent>
      <mimeMap fileExtension=".pdb" mimeType="text/plain" />
    </staticContent>    
</system.webServer>

But I still get a 404 error whenever I try to load one of the files:

HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

I found this SO post that talks about running a utility to register the version of .NET you are using, but I believe the context is that of installing a web site on to other serves, not just a simple publish scenario like mine:

"The page you are requesting cannot be served because of the extension configuration." error message

What am I doing wrong? Note this is happening when I run locally with IIS Express from Visual Studio 2013 Update 4.

Community
  • 1
  • 1
Robert Oschler
  • 14,153
  • 18
  • 94
  • 227
  • 1
    change the mimeType to application/octet-stream and see if the results change. Also, ensure that your app is actually recycling (maybe even stop/start IIS express). Lastly, .pdb is also the file extension for .NET debug symbol files, so there may be some security considerations coming into play with that particular extension. – Tommy Jan 16 '15 at 22:26
  • @Tommy Thanks. I'll try those tips now. Which Web.config should I be modifying? The one in the Views folder or the top level one? – Robert Oschler Jan 16 '15 at 22:39
  • @Tommy My problem was simpler sadly. I was putting my Mime type declarations in the Views Web.config instead of the Global Web.config. As soon as I moved the exact declaration I showed above into the Global Web.config, it started working. Sorry for the confusion. Quite frankly, I don't even know what the purpose of the Views Web.config is. – Robert Oschler Jan 16 '15 at 22:42

0 Answers0