0

In .NET 4.0 - wcf APPLICAITOn project, I have added - DI using- nInject.WCF.Extension package.

VErsio is : Ninject.Extensions.Wcf.3.2.1.0

when try to run the WCF service on browser, some times it throws below exception.

Could not load file or assembly 'System.Web.MVC, Version=3.0.0.0 in WCF project .NET framework 4

Some time also throw below exception:

CanNot:null root. Argument exception

Please help me, how to resolve this.

Thanks

user3711357
  • 1,425
  • 7
  • 32
  • 54
  • i think this is a duplicate of http://stackoverflow.com/questions/24028580/could-not-load-file-or-assembly-system-web-mvc-version-3-0-0-0-culture-neutra or otherwise http://stackoverflow.com/questions/24282393/fileloadexception-after-installing-ninject-mvc5/24307391#24307391 – BatteryBackupUnit Jul 17 '14 at 09:10
  • I tried serveral approach. but not worked so,i need to post here. – user3711357 Jul 17 '14 at 09:22

1 Answers1

1

Update the Application web.config File.

Be sure to make these changes in the app web.config file, not the web.config file in the Views folder.

 <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
         <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
         <bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
     </dependentAssembly>
    </assemblyBinding>
</runtime>

This example referes to MVC 5. Set oldVersion and newVersion according to your project's MVC version.

amighty
  • 784
  • 4
  • 12