0

I wish to integrate YAF.NET (http://yafnet.codeplex.com/) into an existing web site written years ago in MVC 2.0. I wish to have it as a standalone forum, not integrated into my existing pages.

I create a directory and copied all the necessaries files, bin, .config and so on but I get this error:

"Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified."

I don't understand why he is trying to load mvc dll .. anyone could help me with this stuff?

tereško
  • 58,060
  • 25
  • 98
  • 150
Davide
  • 1,305
  • 3
  • 16
  • 36

2 Answers2

1

Web.config files inherit from their parents, so if your root website is setup for MVC your application web.configs will inherit those settings.

In this case the root web.config likely added a couple of assembly references which you will need to strip out. The easy way is to add a <clear /> rule to the assembly section (in system.web):

<compilation>
  <assemblies>
    <clear />
    <!-- add new assembly references here -->
  </assemblies>
</compilation>

The alternative is to use remove rules which alllow you to remove specific references.

 <compilation>
  <assemblies>
    <remove assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  </assemblies>
 </compilation>
Chris Van Opstal
  • 36,423
  • 9
  • 73
  • 90
  • That makes sense, much more than my "homemade" solution to copy the dlls to the bun folder ;) Thank you very much mate! – Davide Dec 10 '12 at 11:00
0

Simple .. is Sunday, sorry :)

I needed to copy in my forum folder all YAF's dll + ASP.NET MVC dll + add in YAF's web.config the following lines:

Davide
  • 1,305
  • 3
  • 16
  • 36