I porting an old site into MVC 4 and I have it working so far. However there is also a third party forum which we use which isn't changing. In IIS 7 I created a new Application for the forum and it also has its own app pool (MVC is .NET4 and forum is .NET 2).
The applications are in different physical directories on the server, and here's what the IIS directory structure looks like with ForumApp being the sub-application:
RootMVCSite
RootMVCSitein
RootMVCSite[OTHERMVCFILESANDFOLDERS]
RootMVCSiteweb.config
RootMVCSiteForumApp
RootMVCSiteForumAppin
RootMVCSiteForumApp[OTHERFORUMAPPFILESANDFOLDERS]
RootMVCSiteForumAppweb.config
However, when I go to the forum I get the following error:
Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
Line 20: <system.web>
Line 21: <compilation targetFramework="4.0" />
The confusing part is that it is looking in the web.config for the root MVC site rather than the forum site where the sub-application is pointing. What do I need to do in IIS or web.config to fix this? Is there a way to prevent the sub-app from looking at the root site's web.config?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…