Compilation Error: "higher version than referenced assembly " - asp.net-mvc-3

I got error on my view page so I updated my visual studio to mvc4, though I am working on mvc3. I 1st updated using NuGet but it don't works so, I updated through standalone MVC4. so it worked. But when I tried to run MVC3 project it gives me following Error:
CS1705: Assembly 'MVC3Project, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null' uses 'System.Web.Mvc, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher
version than referenced assembly 'System.Web.Mvc, Version=3.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35'
Can anyone help me with this?

Inside the web.config file in the Views folder there is the host element under system.web.webPages.razor
This should be as follows for an MVC3 project:
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
While for MVC4 it is:
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
You also need to check the pages element is as follows for MVC3
<pages
validateRequest="false"
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<controls>
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
</controls>
</pages>
and the sectionGroup element:
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
In the main web.config in the root directory of the project you need to make sure that the assemblies element is as follows:
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
There are more changes to make - best bet is to look at the web.config files for an MVC3 project and an MVC4 project and remove the stuff that shouldn't be there in yours.

I had the exact same problem with a later version of MVC. After I updated all my packages through Nugget, the problem is resolved.

The following worked for me
Install-Package Microsoft.AspNet.Web.Optimization

The worked solution for me i deleted the reference in project which gives error.
Reinstall that again with right click project -> add references --> search the name of Assembly then add that again.
for this question you have to delete System.Web.Mvc under first project references and click project -> add references --> Search System.Web.Mvc (you will see that is 4.0.0.0 now) install it.

you can download System.Web.Mvc.dll with version that you are looking for then :
Reference -> add ->browse and select ur file.
this solution worked for me !!
Good luck

Related

How to resolve assembly conflict in Visual Studio 2013 web app project?

I have inherited a web app which reports the following assembly conflict when I try to build it under Visual Studio 2013;
There was a conflict between "System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
"System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was chosen because it was primary and "System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was not.
References which depend on "System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Web.Mvc.dll].
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Web.Mvc.dll
Project file item includes which caused reference "C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Web.Mvc.dll".
System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL
References which depend on "System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [].
C:\Users\Administrator\Source\Repos\eRTQ\Software\web\ThirdPartyDll\MIM.Framework.Unity.dll
Project file item includes which caused reference "C:\Users\Administrator\Source\Repos\eRTQ\Software\web\ThirdPartyDll\MIM.Framework.Unity.dll".
MIM.Framework.Unity, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
MIM.Core.ServiceHosts, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
C:\Users\Administrator\Source\Repos\eRTQ\Software\web\ThirdPartyDll\Microsoft.Web.Mvc.FixedDisplayModes.dll
Project file item includes which caused reference "C:\Users\Administrator\Source\Repos\eRTQ\Software\web\ThirdPartyDll\Microsoft.Web.Mvc.FixedDisplayModes.dll".
Microsoft.Web.Mvc.FixedDisplayModes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL
The Web.config contains this with respect to that assembly;
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
and
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.1"/>
</dependentAssembly>
I've tried removing and re-adding the assembly reference. That doesn't seem to change anything.
I can change the version in Web.config from '4.0.0.1' to '4.0.0.0', and that eliminates the warning, but is it the right thing to do?
Ideas?

When I Use VS2015 and Develop MVC3 Program, there have been some strange problems

There is a MVC3 program developed and compile using VS2012. It's OK and deployed is also OK.
But when I use VS2015 compile,http://i.stack.imgur.com/eMep6.png,not error,just warning。
but when deploy,It can't run.The error http://i.stack.imgur.com/Jgr4k.png.The error text is
[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. Type B originates from 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\7c2060f6\6145b34e\assembly\dl3\9036b7c7\fc8023c0_73fecb01\System.Web.WebPages.Razor.DLL'.
So,I Know I should be good to learn English, but now what should I do?
some Solution,but did not succeed: http:// www.cnblogs.com/shanyou/archive/2012/12/23/2830367.html
http:// www.cnblogs.com/highend/archive/2011/04/20/aspnet_mvc3_the_project_debug_in_mvc3source.html
This is my razor version:
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
Mvc3 is supported till VS2010.I use VS2010SP1 btw.
You have to choose if you want to use Mvc3 or VS2015

Visual Studio 2012 loading error

I have an error when I load Visual Studio 2012: "An exception has been encountered. This may be caused by an extension."
And here is the message from the xml file:
System.ComponentModel.Composition.CompositionException: The composition produced a single composition error, with 2 root causes.
The root causes are provided below.
Review the CompositionException.Errors property for more detailed information.
) The export Microsoft.VisualStudio.Shell.SVsServiceProvider is not assignable to type System.Boolean.
Resulting in: Cannot set import &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IRegistryManager.IsKnockoutEnabled (ContractName="Microsoft.VisualStudio.Shell.SVsServiceProvider")&apos; on part &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager&apos;.
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IRegistryManager.IsKnockoutEnabled (ContractName="Microsoft.VisualStudio.Shell.SVsServiceProvider") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager
Resulting in: Cannot get export &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IRegistryManager")&apos; from part &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager&apos;.
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IRegistryManager") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.RegistryManager
Resulting in: Cannot set import &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IBufferFeatureManagerProvider.teBufferFeatureManager (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IRegistryManager")&apos; on part &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.BufferFeatureManagerProvider&apos;.
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IBufferFeatureManagerProvider.teBufferFeatureManager (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IRegistryManager") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.BufferFeatureManagerProvider
Resulting in: Cannot get export &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.BufferFeatureManagerProvider (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IBufferFeatureManagerProvider")&apos; from part &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.BufferFeatureManagerProvider&apos;.
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.BufferFeatureManagerProvider (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IBufferFeatureManagerProvider") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.BufferFeatureManagerProvider
Resulting in: Cannot set import &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider.BufferFeatureManagerProvider (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IBufferFeatureManagerProvider")&apos; on part &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider&apos;.
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider.BufferFeatureManagerProvider (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.IBufferFeatureManagerProvider") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider
Resulting in: Cannot get export &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider (ContractName="Microsoft.VisualStudio.Text.Tagging.IViewTaggerProvider")&apos; from part &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider&apos;.
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider (ContractName="Microsoft.VisualStudio.Text.Tagging.IViewTaggerProvider") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider
2) The export &apos;Microsoft.VisualStudio.Web.Extensions.HTML.TagNameProvider (ContractName="Microsoft.VisualStudio.Web.Extensions.HTML.ITagNameProvider")&apos; is not assignable to type &apos;System.Collections.Generic.ISet`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]&apos;.
Resulting in: Cannot set import &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.ISPASupportedTagProvider.SupportedTagNames (ContractName="Microsoft.VisualStudio.Web.Extensions.HTML.ITagNameProvider")&apos; on part &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.SPASupportedTagSet&apos;.
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.ISPASupportedTagProvider.SupportedTagNames (ContractName="Microsoft.VisualStudio.Web.Extensions.HTML.ITagNameProvider") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.SPASupportedTagSet
Resulting in: Cannot get export &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.SPASupportedTagSet (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.ISPASupportedTagProvider")&apos; from part &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.SPASupportedTagSet&apos;.
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.SPASupportedTagSet (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.ISPASupportedTagProvider") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.SPASupportedTagSet
Resulting in: Cannot set import &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider.TagNameProvider (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.ISPASupportedTagProvider")&apos; on part &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider&apos;.
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider.TagNameProvider (ContractName="Microsoft.VisualStudio.JavaScript.Web.Extensions.Shared.ISPASupportedTagProvider") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider
Resulting in: Cannot get export &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider (ContractName="Microsoft.VisualStudio.Text.Tagging.IViewTaggerProvider")&apos; from part &apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider&apos;.
Element: Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider (ContractName="Microsoft.VisualStudio.Text.Tagging.IViewTaggerProvider") --> Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider
at System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart(ImportEngine engine, ComposablePart part, ExportDefinition definition)
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue(CatalogPart part, ExportDefinition export, Boolean isSharedPart)
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.CatalogExport.GetExportedValueCore()
at System.ComponentModel.Composition.Primitives.Export.get_Value()
at System.ComponentModel.Composition.ExportServices.GetCastedExportedValue[T](Export export)
at System.ComponentModel.Composition.ExportServices.<>c__DisplayClass4`2.<CreateStronglyTypedLazyOfTM>b__1()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at System.Lazy`1.get_Value()
at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.GatherTaggers(ITextBuffer textBuffer)</description>
Does anybody know I can fix it?
Regards,
Benjamin
Cool, this is what worked for me, update the assemblies tag in the web.config file. During the load of the project the IDE is not able to load those assemblies. So here is my below...
<add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Services.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

MVC 3 assembly conflict How to

Every time I download some open source or paid MVC3 app I get some assembly conflicts, ie: missing assemblies, wrong versions etc. So I figure I should ask a more general question:
In a typical project you have a folder called References and all assemblies seem to be in that folder, with their version numbers and Copy To Local options etc.
However out of the 10-20 references in that folder I often find just a few in the web.config.
I the latest case of this annoying mixup I have in web.config:
<compilation debug="false" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
I get an error that project trying to load System.Web.Helpers, Version=1.0.0.0 - it's not found.
In the References folder the System.Web.Helpers referenced is version 2.0.0 and it's not possible to change this version number as it's greyed out. Changing to Specific Version doesn't change anything.
Question:
Why are there the 4 references in Web.config? Why not just the references folder?
Why do i often find a partial number of assembly tags in web.config instead of none or alternatively all the references seen under the References project folder?
Thanks,
Maybe try to re-install MVC3? Those references in the Web.config are ok, as they should be...
Here is my Web.config, in that part....
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

how to resolve runtime error in mvc3 razor view (Assembly 'MvcApplication2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null')

I want to create a mvc3 web razor application in visual studio 2010 professional. I added mvc3 web project with razor view but when i compile it it gives error of MVC.WEB.dll older version. then i updated mvc.web.dll to version 4 and web.mvc.webpages to version 2 in my refference assemblieis.
I already added the web.config file configurations when it gives compile time error as show below
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
</assemblies>
</compilation>
but now it not give the compile time error as shown below.
Assembly 'MvcApplication2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
Please help me to resolve this matter.
I want to create a mvc3 web razor application
and then
i updated mvc.web.dll to version 4
what?
Exception ... which has a higher version than referenced assembly ...
Try to remove reference from project references (left click on System.Web.Mvc and press delete), then References -> Add reference sort by name on first tab and select System.Web.Mvc with 4.0.0.0 in second column (version).
Under the References you will find the System.Web.Mvc referenced
remove this reference and add a new reference of higher version i.e 4.x

Resources