We did a fresh deployment of our application on a new server. On this computer, when we tried to access any of the pages of our application we got an error which looked like
![]() |
Virtual Path Maps to Another Application, is not allowed |
We tried to find out what were the differences between the other server and this new server. We narrowed it down to one very interesting difference, we used to deploy our project as a website in IIS on all other server. While on the server that was giving us exceptions, we deployed our application as a virtual directory under the default website. This very curious difference was giving us exceptions while initializing the spring context.
I Googled a little and found out that this is a known issue which has been reported here and here.
The workaround to this issue was simple enough, we just have to give a name the spring context in web.config.
Would any random name work? Do we have to follow some convention?
Our Spring.NET section in web.config file looked like
By now it should be clear that, we have to add a name attribute to
This did the trick! After making this change we were able to browse all pages in our application and Spring.NET integration with MVC3 application was working well!
Small issues like these have very simple solutions but, one might end up spending quite some time before finding a satisfactory solution. I decided to document my finding for the benefit of the community!