Incorrect dll references when upgrading to 6.1
I know of a few others who have had a similar issue so I am going to post this under the bugs section until I hear otherwise.
When upgrading from 6.0 to 6.1 via the project manager the solution (your reference path for each dll) will target the wrong version for the following DLL's:
System.Web.Mvc -> targets MVC3 instead of MVC4 of your local path for the MVC installation.
System.Web.Razor -> targets v1.0 instead of v2.0 of your local installation of ASP.NET Web Pages
System.Web.WebPages -> targets v1.0 instead of v2.0 of your local installation of ASP.NET Web Pages
System.Web.WebPages.Deployment -> targets v1.0 instead of v2.0 of your local installation of ASP.NET Web Pages
System.Web.WebPages.Razor -> targets v1.0 instead of v2.0 of your local installation of ASP.NET Web Pages
Changing all these references to the dll's in the project's bin folder prior to building fixed the errors I was seeing. I would assume you can safely just change them to use the correct version path of your local install too.
Hello,
The references from the project manager are already fixed, thank you for providing the solution to the problem for everyone encountering it.
Regards,
Stanislav Velikov
Telerik
Stanislav, are you sure they are fixed? I just downloaded a new installer, tried to upgrade the site from 6 to 6.1 and got this error:
Server Error in '/' Application.
Could not load file or assembly 'System.Web.Mvc,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The located assembly's manifest definition does
not match the assembly reference. (Exception from HRESULT: 0x80131040)
Description: An unhandled exception occurred during
the execution of the current web request. Please review the stack trace
for more information about the error and where it originated in the
code.
Exception Details: System.IO.FileLoadException:
Could not load file or assembly 'System.Web.Mvc, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its
dependencies. The located assembly's manifest definition does not match
the assembly reference. (Exception from HRESULT: 0x80131040)
Source Error:
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be
helpful to determine why the assembly 'System.Web.Mvc, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.
=== Pre-bind state information ===
LOG: User = WEB1\Administrator
LOG: DisplayName = System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///D:/citynet.annapolis.gov/
LOG: Initial PrivatePath = D:\citynet.annapolis.gov\bin
Calling assembly : Telerik.Sitefinity, Version=6.1.4300.0, Culture=neutral, PublicKeyToken=b28c218413bdf563.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\citynet.annapolis.gov\web.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/96e0ee6d/c24b8ff3/System.Web.Mvc.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/96e0ee6d/c24b8ff3/System.Web.Mvc/System.Web.Mvc.DLL.
LOG: Attempting download of new URL file:///D:/citynet.annapolis.gov/bin/System.Web.Mvc.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Stack Trace:
[FileLoadException: Could not load file or assembly 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
Telerik.Sitefinity.Abstractions.Bootstrapper.RegisterRoutes() +0
Telerik.Sitefinity.Abstractions.Bootstrapper.Bootstrap() +374
Telerik.Sitefinity.Web.SitefinityHttpModule.Init(HttpApplication context) +112
System.Web.Routing.UrlRoutingModule.System.Web.IHttpModule.Init(HttpApplication application) +10
System.Web.HttpApplication.InitModulesCommon() +172
System.Web.HttpApplication.InitModules() +43
System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +828
System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +304
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +327
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
Or it's something else this time?
Just followed Stacy's suggestion to fix version 6.1.4300.0.
All had worked properly on our local server. Errors popped up today when we deployed to our production server.
Thanks, Stacy.
Hi,
Following the error message the cause of the problem is due to the inccorect assembly reference for System.Web.Mvc assemblies those have to me refering to version 4.0 and not the previous version 3.0 for Asp.Net MVC as Stacey have explained in more detail.
Regards,
Stanislav Velikov
Telerik
Having this issue on upgrading from 6.1 to 6.3.
Works great on localhost (IIS7.5) but not on production server (IIS6.1). Have followed Staceys suggestions, but no luck.
OC
Hi,
@ OC if the error experienced when running on IIS 6 is the same as the error when lacking assembly references for System.Web.Mvc.dll.
Could not load file or assembly 'System.Web.Mvc,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies.
Thanks Stanislav,
It was Visual Studio messing up the DLLs on rebuild. Found it on another thread. For some strange reason Visual Studio replaced all DLLs after a couple of re-builds. I see others have experienced the same. DLLs published to Production server where the old ones.
Strange, but solved :)
Hello,
Basically the rebuild process can cause the removal of the assembly references if those are located in the bin folder, here is a popular topic that discuss this. A good practice is to add assembly references from a folder different from bin (for example lib folder).
Regards,
Stanislav Velikov
Telerik