Aruna
Aruna

Reputation: 2052

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?

Upvotes: 3

Views: 503

Answers (3)

Aruna
Aruna

Reputation: 2052

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.

Upvotes: 2

harini88
harini88

Reputation: 151

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

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

Upvotes: 2

CMayers
CMayers

Reputation: 9

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

Upvotes: 0

Related Questions