Archive for the 'ASP.NET' Category

Published by breki on 12 Jul 2010

Uri Class Cheat Sheet

Another reference post, this time covering usage of .NET Uri class.

Example URL: http://somewhere.else.com:9999/service/packages?page=2#fragment

The table below contains values for various properties of Uri for that example URL:

AbsolutePath /service/packages
AbsoluteUri http://somewhere.else.com:9999/service/packages?page=2#fragment
Authority somewhere.else.com:9999
DnsSafeHost somewhere.else.com
Fragment #fragment
Host somewhere.else.com
HostNameType Dns
IsAbsoluteUri true
IsDefaultPort false
IsFile false
IsLoopback false
IsUnc false
LocalPath /service/packages
OriginalString http://somewhere.else.com:9999/service/packages?page=2#fragment
PathAndQuery /service/packages?page=2
Port 9999
Query ?page=2
Scheme http
Segments array: “/”, “service/”, “packages”
UserEscaped false
UserInfo “” (empty string)

Published by breki on 07 Jul 2010

System.Web.HttpRequest Paths Cheat Sheet

More a “remember” post for me than a real reference thing, but I think it might be useful to anybody doing more than simple work with HttpRequests.

Example request URL: http://localhost:65107/Services.svc/services?page=30

The table below contains values for various path-related properties of HttpRequest for that example request URL:

ApplicationPath /
AppRelativeCurrentExecutionFilePath ~/Services.svc
CurrentExecutionFilePath /Services.svc
FilePath /Services.svc
Path /Services.svc/services
PathInfo /services
PhysicalApplicationPath D:\svn\eEnvoyer\SEPA\EEnvoyer.Server\
PhysicalPath D:\svn\eEnvoyer\SEPA\EEnvoyer.Server\Services.svc
RawUrl /Services.svc/services?page=30
Url http://localhost:65107/Services.svc/services?page=30

Published by breki on 10 Jun 2009

ASP.NET MVC: Use Integrated Managed Pipeline Mode

A note to myself: the IIS application under which an ASP.NET MVC application runs has to be set up to use Integrated Managed Pipeline Mode (Advanced Settings…), otherwise you’ll end up with the

HTTP Error 404.0 – Not Found

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

error for any virtual URL (other than the default one).

This of course applies to IIS 6 and above.