In a previous article, I wrote about hosting an ASP.NET MVC app on a virtual directory on Azure. You can find the article in the link below. The main goal of that article was to show how to hosts other sites within the same Azure Web app.
There are cases when the multiple sites have similar routes and controllers, and the application find this ambiguous and does not know how to handle a request showing this error:
|
Review Deployment and Configuration
When facing such error, we need to check the following possible problems:
1) When doing the deployment, we need to make sure the destination URL includes the virtual directory folder
For example: www.mysite.com/admin where admin is the virtual directory folder.
2) Make sure the virtual directory root folder is not the same as the main site
This is a common mistake. When doing the configuration for a virtual directory we must make sure to set the correct physical path as shown next:
The image shows how the main application and virtual path use different physical paths. If both are set to the same physical path, then the routes will be processed from both apps with the same route but different controller types which causes the ambiguity.
Before doing the deployment to Azure make sure to test this configuration on your development environment. For those using Visual Studio with IIS Express, you may find this article useful:
I hope this is helpful.
0 comments :
Post a Comment
What do you think?