简体   繁体   中英

Hosting Umbraco site with MVC site in IIS

I have created Umbraco 7 MVC site and deployed it to IIS. So the URL goes like eg: www.mydomain.com. In a sub directory i have hosted a separate MVC web site. so the URL goes eg: www.mydomain.com/MVCApplication.

When I tried to access sub application URL; It gives

Could not load file or assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.

So i added this dll to my bin folder which is in sub directory. Then it prompts another error

Could not load file or assembly 'UrlRewritingNet.UrlRewriter' or one of its dependencies. The system cannot find the file specified.

It seems sub application trying to read root folder dlls or root web.config. Umbraco site is working fine. When i removed the umbraco site, sub application works. Any idea please?

Finally here is the solution. Had to wrap the <System.web> and <system.webServer> with following code snippet in parent web site web.config file. It was not an issue with the references. It was inheriting the parent web.config file in sub web applications:

<location path="." inheritInChildApplications="false">
   <system.web> 
    ...
  </system.web>
</location>

Hope this will help someone else too.

In order to disable umbraco inheritance try wrapping <system.webserver> and <system.web> with <location path="." inheritInChildApplications="false"> <location path="." inheritInChildApplications="false"> in the webconfig

http://www.experts-exchange.com/Networking/Misc/Q_26535962.html

Can you add the following line into your web.config

<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

This should go into the Compilations > assemblies section.

<compilation>
   <assemblies>
   </assemblies>
</compilation>

Can you also ensure that "UrlRewritingNet.UrlRewriter" dll has been refenced correctly in the sub app? Also you could try setting that references 'Copy Local' property to TRUE. You can see these properties by selecting the specific reference and pressing F4 to bring up the Proerties pane.

Regards

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM