1

I've got this small problem, I've got a HG repository server set up and it works fine (at least as far as being a repository & working with HG)

I'm having a problem with the web view because it seems my server wont serve .cs or .csproject files (even though it technically isn't from the context of the hg web view)

My first instinct was to add the MIME type to the server as you can see here:

.cs files added as text/plain

(I've added it at the root webserver level so all sites inherit it)

Anyway, after restarting the IIS Service / App pools / etc... It still is unable to serve .cs files

  • http://myinternalserver/blah.txt Serves fine
  • http://myinternalserver/blah.cs 404's

Am I missing a step here? Is there something funky about a .cs file? It doesn't make sense that it'd be a special type flagged as an "executable" or something because frankly .bat is servable, and it's way more prone to execution that an uncompiled C# file.

Anyone have ideas? Am I just going about this horribly wrong?

Aren B
  • 216
  • 2
  • 12

1 Answers1

2

Look in your web.config and/or applicationhost.config in the <requestFiltering> section. See if you see an entry for .cs and .csproj files with allow set to false:

<add fileExtension=".cs" allowed="false" />
<add fileExtension=".csproj" allowed="false" />

If so, set them to true. They would be under the <fileExtensions> node of the above mentioned <requestFilterings>.

squillman
  • 37,618
  • 10
  • 90
  • 145
  • Thanks, I couldn't find it in my machine.config, app.config, or applicationhost.config but when I added an allowed="true" i got a 500 error, so I figured it was in the list somwhere. Just added `` for both entries in front and it worked \o/, thankyou :) – Aren B Aug 30 '10 at 15:50
  • [This answer](http://stackoverflow.com/a/4715872/838807) is useful when solving this issue as it shows exactly how to structure the web.config file – musefan Jul 21 '15 at 08:34