Sponsored

Showing posts with label IIS. Show all posts
Showing posts with label IIS. Show all posts

Friday, September 19, 2014

404 Error in IIS for a Url with a plus + in the Path

Default Internet Information Server (IIS) behavior since IIS 7 rejects requests to Urls with a plus (+) sing in the path like:

www.somesite.com/one+two or
www.somesite.com/path/subpath/three+four

The behavior is considered a security feature and controlled by a setting called "Double Escaping Filtering". To override the default rejecting behavior the setting needs to be changed either via a web.config configuration:


<system.webServer>
  <security>
    <requestfiltering allowDoubleEscaping="true" />
  </security>
</system.webServer>
or an IIS Management user interface:

Tuesday, December 28, 2010

Set up local SMTP for your .NET development environment on Windows 7

If you are developing a .NET application that sends emails then you need a way to do that without needing to actually send emails out. On Windows 7 with IIS 7 installed you can easily configure a local SMTP service that will intercept all the SMTP sessions initiated in your code and successfully emulate sending the outbound email by saving it as a text file in a folder on your local hard drive. This is extremely convenient and allows you to keep working on your code without interruption even when you are not connected to the Internet.

To achieve that just add a few lines in your application's .config file (could be web.config or app.config). Here is an example of such a configuration:

<system .net="">
  <mailsettings>
     <smtp deliverymethod="SpecifiedPickupDirectory">
        <specifiedpickupdirectory pickupdirectorylocation="c:\smtp">
     </specifiedpickupdirectory></smtp>
  </mailsettings>
</system>

After adding such a configuration every time your application sends an e-mail using a .NET framework built-in SmtpClient.Send method a new file with the .eml extension will appear in the configured folder.

You can open a file with any text editor like Notepad++ for example or you can use this free EML Viewer to improve viewing experience.

Tuesday, December 9, 2008

FIX: HTML documents may not be displayed correctly in IIS 7.0 on Windows Vista

Recently I have finally upgraded to Windows Vista from Windows XP. Except regular trouble of upgrading your operation system that feels like moving to a new house (which is people say worse then an earthquake and flooding together) I was quite frustrated by a number of annoying problems with IIS 7 when first it's not installed by default (all right, security is tougher now, but can I at least have an option?), then not all of the components installed that required by ASP.NET and VS2008 (is it so difficult to suggest a correct package?), then again my web app does not work with the default App Domain (why did you guys call it "default" and the real default call "classic"?), and finally everything works but the site does not look like it should be.

I spent some time probing different setting of IIS and finally gave up and looked it up on the Internet. What a relief! It's a Microsoft bug and not me being an idiot! Actually it was submitted on March 17, 2007 and still not in SP1.

So the problem was that the entire static content of the web app including images and styles was not returning to a browser by IIS (content length 0 bytes) because IIS 7 initial configuration was incorrect when it was first installed on Vista.

I am not describing a fix here, read it here: http://support.microsoft.com/kb/930901/en-us