I have a WebApp which contains following projects:
- Domain (for EF)
- Common (for common business logics)
- Admin (for Admin Tool)
- Shop (for ecommerce part of the website)
- Web (Static web section of the website)
My problem is i had created 2 different projects for static webpages (web) and ecommerce part (shop) however the client wants both to be merged, for e.g.: if the main website is abc.com then instead of having shop.abc.com they want abc.com/shop. Now since i have different project for shop, i created virtual directory in the web project and pointed it to the shop project, but when i access the website at abc.com/shop it throws following error:
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS
First i excluded the web.config from the Shop project but that didn't worked, hence i now converted the virtual directory to Application, now the shop section works as expected. However i have noticed, now it doesn't goes into the Global.asax of Shop project, that's very important for me since i have the Routing defined in the Global.asax.
I know i can move the entire shop section into the web project, but that isn't ideal solution for me, because in case they plan to separate the web and shop in the future, it would be tedious and also it's better to keep the code for the shop and web separate for better readability and debugging.
Can anyone suggest what's wrong with my setup, or what else i can do to run the shop section within the web project.