Wednesday, July 13, 2011

Request.ApplicationPath not supported in Web Role

 

ApplicationPath not supported on Windows Azure. Recently we need to migrate existing .NET 2.0 project to Windows Azure. We upgrade the code to .NET 4.0 and run application locally there is no issue. When we migrated to Windows Azure we discover that the ApplicationPath not working the reason from MSDN forum is….

ApplicationPath is only valuable when you have multiple virtual directories under the IIS web site. But on the cloud machines, each web role (and even each instance) is hosted on a separate virtual machine. Each IIS will contain only one web site with no virtual directories. All web pages are stored under the root web site. So ApplicationPath will always return /, with no meaning on the cloud. 

http://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/9f0c1f8e-cc6d-4d07-9dcd-93db179d3703/

No comments: