Out of a sudden I started to get an error on my MVC Web Application. I get the error:
Could not load file or assembly 'System.Web.Abstractions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
The system cannot find the file specified.
I have it on the References as I have the Routing and the MVC. But the last two are not giving me any problem.
2 things to check, make sure that it's getting copied correctly to your app's bin folder, and try adding the following to web.config to make sure you don't have an assembly still looking for another version...
Asp.Net runtime error: Could not load file or Assembly "System.Web.Abstractions.dll., Version 0.0.0.0, Culture=neutral, PublicToken=31bf385ad364e35" or one of its dependencies. The system cannot find the file specified.
And it also says the code line number in Web.Config which is:
shapper
Contributor
3864 Points
3548 Posts
System.Web.Abstractions Problem
Jun 05, 2008 12:57 PM|LINK
Hello,
Out of a sudden I started to get an error on my MVC Web Application. I get the error:
Could not load file or assembly 'System.Web.Abstractions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
The system cannot find the file specified.
I have it on the References as I have the Routing and the MVC. But the last two are not giving me any problem.
That part o my Web.Config file is.
<compilation debug="true"> <assemblies> <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="System.Web.Abstractions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="System.Web.Routing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> </assemblies> </compilation>I tried to remove the reference and add it again. I rebuilt my solution but I wasn't able to solve it.
Any idea why I am getting this problem?
Thank You,
Miguel
jmeyer43
Member
83 Points
17 Posts
Re: System.Web.Abstractions Problem
Jun 05, 2008 01:58 PM|LINK
2 things to check, make sure that it's getting copied correctly to your app's bin folder, and try adding the following to web.config to make sure you don't have an assembly still looking for another version...
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Abstractions" publicKeyToken="31BF3856AD364E35"/>
<bindingRedirect oldVersion="0.0.0.0-3.5.0.0" newVersion="0.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
if you're also using the dynamic data bits, then reference that version in web.config and the bulid
shapper
Contributor
3864 Points
3548 Posts
Re: System.Web.Abstractions Problem
Jun 05, 2008 02:14 PM|LINK
Hi,
It is not. When I build my solution the DLL files are not copied to the Bin folder because the solution gives an error:
The name 'RenderView' does not exist in the current context ...
I think that I get this error exactly because of the Abstractions problem.
This is the second time I get this problem and the other time I needed to create a complete new solution ... I wasn't able to solve this.
And this problem appeared out of nothing.
I added your code and rebuilt the solution ... but it didn't solve it.
Any idea?
Thank You,
Miguel
shapper
Contributor
3864 Points
3548 Posts
Re: System.Web.Abstractions Problem
Jun 05, 2008 02:20 PM|LINK
I excluded the HomeController from the project and rebuilt my solution. I got no error. The dll files were copied to the Bin folder.
Then I added it again to my project and when rebuild it I got, as always, the same error:
The name 'RenderView' does not exist in the current context ...
I have been trying everything I could think off and also Googled for it but I can't find a solution.
Thanks,
Miguel
shapper
Contributor
3864 Points
3548 Posts
Re: System.Web.Abstractions Problem
Jun 05, 2008 02:23 PM|LINK
I opened the project file with notepad and I have the following:
<Reference Include="System.Data.Linq"> <RequiredTargetFramework>3.5</RequiredTargetFramework> </Reference> <Reference Include="System.Web.Abstractions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\Libraries\Microsoft\MVC Preview 3\System.Web.Abstractions.dll</HintPath> </Reference> <Reference Include="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\Libraries\Microsoft\MVC Preview 3\System.Web.Mvc.dll</HintPath> </Reference> <Reference Include="System.Web.Routing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\Libraries\Microsoft\MVC Preview 3\System.Web.Routing.dll</HintPath> </Reference> <Reference Include="System.Xml.Linq"> <RequiredTargetFramework>3.5</RequiredTargetFramework> </Reference>So the three references (Abstractions, MVC and Routing) are there.
I don't know what else to check.
shapper
Contributor
3864 Points
3548 Posts
Re: System.Web.Abstractions Problem
Jun 05, 2008 02:30 PM|LINK
One more update:
Every time I open Index.aspx view I get an error:
Asp.Net runtime error: Could not load file or Assembly "System.Web.Abstractions.dll., Version 0.0.0.0, Culture=neutral, PublicToken=31bf385ad364e35" or one of its dependencies. The system cannot find the file specified.
And it also says the code line number in Web.Config which is:
And the Index.aspx code line where I get the error is the first one:
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Home.master" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="MyWebSite.Views.Home.Index" %>
Paul Linton
Star
10665 Points
1976 Posts
Re: System.Web.Abstractions Problem
Jun 06, 2008 02:16 AM|LINK
RenderView() does not exist in Preview 3. Your action methods should have something like
return View("whatever",viewData);
Check out http://weblogs.asp.net/scottgu/archive/2008/05/27/asp-net-mvc-preview-3-release.aspx and the Preview 3 Readme document has lots of details.