Related
I'm trying to deploy an mvc application to a server (under my control), but it's doing my head in. The only info I seem to find online is about mvc1->2 upgrades, i'm on .net 4.
Here's the error I'm getting:
Method not found: 'System.Object System.Web.Mvc.ControllerBase.get_ViewBag()'.
I ran the mvc diagnostics utility aspx page, output below.
Any ideas? Thanks everyone...
Errors were found. Please see below for more information.
Environment Information
Operating system: Microsoft Windows NT 6.1.7601 Service Pack 1
.NET Framework version: 4.0.30319.17929 (64-bit)
Web server: Microsoft-IIS/7.5
Integrated pipeline: True
Worker process: w3wp.exe
ASP.NET MVC Assembly Information (System.Web.Mvc.dll)
Multiple ASP.NET MVC assemblies have been loaded into this application.
Assembly version: Unknown version (3.0.11029.0)
Full name: System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Code base: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Web.Mvc/v4.0_3.0.0.0__31bf3856ad364e35/System.Web.Mvc.dll
Deployment: GAC-deployed
Assembly version: Unknown version (4.0.20710.0)
Full name: System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Code base: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Web.Mvc/v4.0_4.0.0.0__31bf3856ad364e35/System.Web.Mvc.dll
Deployment: GAC-deployed
ASP.NET MVC Futures Assembly Information (Microsoft.Web.Mvc.dll)
An ASP.NET MVC Futures assembly has not been loaded into this application.
All Loaded Assemblies
74 assemblies are loaded.
•A_e821af9e_9cb7_4a6b_bbb0_ecd9d1e31323, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
•Anonymously Hosted DynamicMethods Assembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
•App_global.asax, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
•App_Web_gcumpw0y, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
•EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•HttpToHttpsRedir, Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•Microsoft.JScript, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•Microsoft.Transactions.Bridge, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•Microsoft.VisualBasic.Activities.Compiler, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•MvcPaging, Version=1.0.2.0, Culture=neutral, PublicKeyToken=null
•PinLookup, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
•SMDiagnostics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Data.Services.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Data.SqlXml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.DirectoryServices.Protocols, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Messaging, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Runtime.Caching, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.Runtime.DurableInstancing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.ServiceModel.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.ServiceModel.Internals, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.Mobile, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.RegularExpressions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.WebPages.Deployment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Workflow.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Workflow.ComponentModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Workflow.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.WorkflowServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Xaml.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Diagnostics version: 02/16/2010 00:00:00 v7
Report generated on: 06/19/2013 22:11:40
It looks like you're missing the reference to Microsoft.Web.Mvc.
ASP.NET MVC Futures Assembly Information (Microsoft.Web.Mvc.dll)
An ASP.NET MVC Futures assembly has not been loaded into this application.
Try setting the dll to copy local in the project settings and then republish
Thanks for all comments.
In the end it turned out that there was version mismatches of the mvc assemblies in the gac, for some reason they must not have installed properly, even though there was no errors displayed during the installation.
I did try to deploy the required assemblies with my application, but the gac assemblies override local assemblies, even though the deployed assemblies are newer.
After a complete uninstall and reinstall of mvc3, mvc4, .net4.5 and .net4 (and the reboots that .net4.5 requires - very annoying!) it finally worked fine. It's the 4th server I have deployed this particular application to - in each case there were no previous mvc applications so I installed the runtimes - and the first one to cause a headache like that.
Anyway, hope it helps someone else down the track.
I'm receiving the following error from StructureMap when initializing my ObjectFactory.
StructureMap.StructureMapException occurred HResult=-2146232832
Message=StructureMap Exception Code: 202 No Default Instance defined
for PluginFamily
System.Collections.Generic.IDictionary2[[System.Type, mscorlib,
Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089],[System.Func2[[System.Data.Entity.DbContext,
EntityFramework, Version=5.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089],[System.Object, mscorlib,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]],
mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089 Source=StructureMap
ErrorCode=202 StackTrace:
at StructureMap.BuildSession.<.ctor>b__0(Type t) in c:\BuildAgent\work\767273992e840853\src\StructureMap\BuildSession.cs:line
33 InnerException:
From previous answers, it looks like I'm missing a reference to an assembly, but I'm including a heck of a lot now. Here's my full initialization statement:
ObjectFactory.Initialize(x =>
{
x.Scan(scan =>
{
scan.TheCallingAssembly();
scan.WithDefaultConventions();
scan.AssembliesFromApplicationBaseDirectory();
});
x.For<IRepositoryProvider>().Use<RepositoryProvider>();
x.For<IDataUow>().Use<DataInterface>();
x.Forward<IDataUow, IDisposable>();
x.For<RepositoryFactories>().Singleton();
});
I have no problems using AForge classes in a Windows Form application in Visual Studio. I am now trying to use them in Windows PowerShell.
[Reflection.Assembly]::LoadFile('C:\Program Files\AForge.NET\IPLab\References\AForge.NET\AForge.Imaging.dll')
gives:
GAC Version Location
--- ------- --------
False v2.0.50727 C:\Program Files\AForge.NET\IPLab\References\AForge.NET\AForge.Imaging.dll
It says v2.0.50727 even though the AForge.Imaging.dll File Version and Product Version are both 2.2.4.0. But I have no problems executing the following to instantiate an AForge.Imaging.UnmanagedImage object $umi (where $bmdata is an Drawing.BitMapData object):
$umi = new-object Aforge.Imaging.UnmanagedImage $bmdata
But the moment I tried to access the $umi object, for example $umi.GetType(), I get the following error:
The following exception occurred while retrieving member "GetType": "Could not load file or assembly 'AForge, Version=2.2.4.0, Culture=neutral, PublicKeyToken=c1db6ff4eaa06aeb' or one of its dependencies. The system cannot find the file specified."
At line:1 char:13
+ $umi.GetType <<<< ()
+ CategoryInfo : NotSpecified: (:) [], ExtendedTypeSystemException
+ FullyQualifiedErrorId : CatchFromBaseGetMember
What could be wrong? Thanks.
The "AForge.Imaging.dll" library depends on the following libraries that must also be loaded;
Add-Type -AssemblyName "System.Drawing"
Add-Type -Path "E:\AForge.dll"
Add-Type -Path "E:\AForge.Math.dll"
Add-Type -Path "E:\AForge.Imaging.dll"
run the following PowerShell command to list the currently loaded assemblies and verify you have the necessary bits.
[appdomain]::currentdomain.getassemblies() | sort -property fullname | format-table fullname
Here were my results:
FullName
--------
AForge, Version=2.2.4.0, Culture=neutral, PublicKeyToken=c1db6ff4eaa06aeb
AForge.Imaging, Version=2.2.4.0, Culture=neutral, PublicKeyToken=ba8ddea9676ca48b
AForge.Math, Version=2.2.4.0, Culture=neutral, PublicKeyToken=abba2e25397ee8c9
Microsoft.PowerShell.Commands.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Microsoft.PowerShell.Commands.Management, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Microsoft.PowerShell.Commands.Utility, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Microsoft.PowerShell.ConsoleHost, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Microsoft.PowerShell.Security, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Microsoft.WSMan.Management, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
I can confirm this worked for me.
Run Process Monitor and check what assembly it is looking for and where. It may be that one of the assemblies needed by AForge.NET cannot be found, or some security limitations. Sometimes similar problems can be if you are trying to load 32 bit version of DLL into 64 bit powershell and vice versa
Install aforge.video in project from where you are calling function- Following is the syntax for nuget console
Install-Package AForge.Video -Project "ProjectNameFromWhichAforgeFunctionCalls" -Version 2.2.4.0
This solved my problem
So this is kind of a crazy problem to me, but I've had no luck Googling it. I have an ASP.NET MVC 2 application (under .NET 4.0) running locally just fine. When I upload it to my production server (under shared hosting) I get
Compiler Error Message: CS1061:
'System.Web.Mvc.HtmlHelper<TheActivityTracker.Resident>' does not
contain a definition for 'TextBoxFor' and no extension method
'TextBoxFor' accepting a first argument of type
'System.Web.Mvc.HtmlHelper<TheActivityTracker.Resident>' could be
found (are you missing a using directive or an assembly reference?)
for this code:
<%= this.Html.TextBoxFor(person => person.LastName) %>
This is one of the new standard extension methods in MVC 2. So I wrote some diagnostic code:
System.Reflection.Assembly ass = System.Reflection.Assembly.GetAssembly(typeof(InputExtensions));
Response.Write("From GAC: " + ass.GlobalAssemblyCache.ToString() + "<br/>");
Response.Write("ImageRuntimeVersion: " + ass.ImageRuntimeVersion.ToString() + "<br/>");
Response.Write("Version: " + System.Diagnostics.FileVersionInfo.GetVersionInfo(ass.Location).ToString() + "<br/>");
foreach (var method in typeof(InputExtensions).GetMethods())
{
Response.Write(method.Name + "<br/>");
}
running locally (where it works fine), I get this as output:
From GAC: True
ImageRuntimeVersion: v2.0.50727
Version: File: C:\Windows\assembly\GAC_MSIL\System.Web.Mvc\2.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll InternalName: System.Web.Mvc.dll OriginalFilename: System.Web.Mvc.dll FileVersion: 2.0.50217.0 FileDescription: System.Web.Mvc.dll Product: Microsoft® .NET Framework ProductVersion: 2.0.50217.0 Debug: False Patched: False PreRelease: False PrivateBuild: False SpecialBuild: False Language: Language Neutral
CheckBox
CheckBox
CheckBox
CheckBox
CheckBox
CheckBox
CheckBoxFor
CheckBoxFor
CheckBoxFor
Hidden
Hidden
Hidden
Hidden
HiddenFor
HiddenFor
HiddenFor
Password
Password
Password
Password
PasswordFor
PasswordFor
PasswordFor
RadioButton
RadioButton
RadioButton
RadioButton
RadioButton
RadioButton
RadioButtonFor
RadioButtonFor
RadioButtonFor
TextBox
TextBox
TextBox
TextBox
TextBoxFor
TextBoxFor
TextBoxFor
ToString
Equals
GetHashCode
GetType
and when running on the production server (where it fails), I see:
From GAC: True
ImageRuntimeVersion: v2.0.50727
Version: File: C:\Windows\assembly\GAC_MSIL\System.Web.Mvc\2.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll InternalName: System.Web.Mvc.dll OriginalFilename: System.Web.Mvc.dll FileVersion: 2.0.50217.0 FileDescription: System.Web.Mvc.dll Product: Microsoft® .NET Framework ProductVersion: 2.0.50217.0 Debug: False Patched: False PreRelease: False PrivateBuild: False SpecialBuild: False Language: Language Neutral
CheckBox
CheckBox
CheckBox
CheckBox
CheckBox
CheckBox
Hidden
Hidden
Hidden
Hidden
Hidden
Hidden
Password
Password
Password
Password
RadioButton
RadioButton
RadioButton
RadioButton
RadioButton
RadioButton
TextBox
TextBox
TextBox
TextBox
ToString
Equals
GetHashCode
GetType
note that "TextBoxFor" is not present (hence the error).
I have MVC referenced in the csproj:
<Reference Include="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>True</SpecificVersion>
<HintPath>References\System.Web.Mvc.dll</HintPath>
<Private>True</Private>
</Reference>
Upon user Levi's suggestion, I uploaded and ran the MvcFutures' diagnostics page - here's the innocent looking output:
Microsoft ASP.NET MVC Diagnostics Information
This page is designed to help diagnose common errors related to mismatched or conflicting ASP.NET MVC binaries. If a known issue is identified, it will be displayed below in red text.
For questions or problems with ASP.NET MVC or this utility, please visit the ASP.NET MVC forums at http://forums.asp.net/1146.aspx.
Environment Information
Operating system: Microsoft Windows NT 6.0.6002 Service Pack 2
.NET Framework version: 4.0.30319.1 (32-bit)
Web server: Microsoft-IIS/7.0
Integrated pipeline: True
Worker process: w3wp.exe
ASP.NET MVC Assembly Information (System.Web.Mvc.dll)
Assembly version: ASP.NET MVC 2 RTM (2.0.50217.0)
Full name: System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Code base: file:///C:/Windows/assembly/GAC_MSIL/System.Web.Mvc/2.0.0.0__31bf3856ad364e35/System.Web.Mvc.dll
Deployment: GAC-deployed
ASP.NET MVC Futures Assembly Information (Microsoft.Web.Mvc.dll)
An ASP.NET MVC Futures assembly has not been loaded into this application. If desired, you can download ASP.NET MVC 2 RTM Futures from http://go.microsoft.com/fwlink/?LinkID=183739.
All Loaded Assemblies
50 assemblies are loaded.
* A_d509bf65_3d32_48f0_8ab6_566e289003a6, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
* Anonymously Hosted DynamicMethods Assembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
* App_global.asax.5qqlf9ir, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
* App_Web_2vnklzay, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
* App_Web_n3cjbc0f, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
* App_Web_v3sxbd4u, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
* DotNetPanel.IIsModules, Version=1.0.0.0, Culture=neutral, PublicKeyToken=37f9c58a0aa32ff0
* Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
* Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
* Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
* Microsoft.JScript, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
* mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
* SMDiagnostics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
* System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
* System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
* System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
* System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
* System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
* System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
* System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
* System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
* System.Data.Services.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
* System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
* System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
* System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
* System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
* System.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
* System.Runtime.Caching, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
* System.Runtime.DurableInstancing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
* System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
* System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
* System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
* System.ServiceModel.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
* System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
* System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
* System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
* System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
* System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
* System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
* System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
* System.Web.Mobile, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
* System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
* System.Web.RegularExpressions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
* System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
* System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
* System.WorkflowServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
* System.Xaml.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
* System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
* System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
* TheActivityTracker, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
Diagnostics version: 02/16/2010 00:00:00 v7
Report generated on: 05/05/2010 18:12:56
I just can't figure it what to do next. Thoughts?
Thanks!
-Mike
Your hoster is running a prerelease version of MVC 2. (Even worse, they seem to have GACed it!) They might also be running a prerelease version of the .NET 4 Framework.
Call them and tell them to upgrade to the RTM builds. :)
Try removing the hint path and specific version
<Reference
Include="System.Web.Mvc, Version=2.0.0.0,
Culture=neutral,
PublicKeyToken=31bf3856ad364e35,
processorArchitecture=MSIL" />
Is there a way to get the current version of ASP.NET MVC in code? Reflecting on MVC assemblies is needed? Any new IIS server variables? Some property to read in HTTP context?
Go to your References folder
Look for System.Web.Mvc
Right Click on it
Click Properties
Look at the Version property.
This is most likely your version but the GAC may play a role in messing you around.
Via Reflection:
typeof (Controller).Assembly.GetName().Version
Open the packages.config in your solution explorer..
Then look for ASP.NET MVC package ID, as follows:
id="Microsoft.AspNet.Mvc" version="5.2.2" targetFramework="net452"
At runtime-
string mvcVersion = typeof (Controller).Assembly.GetName().Version.ToString();
At design time-
Go to your reference folder
look for system.web.mvc
Right Click on it
Click Properties Look at the Version property
.
On the off chance you do not have access to the code and/or want to determine the version of ASP.NET that has been deployed on a machine, you can do the following (from TechNet):
How do I determine which version of ASP.NET MVC is installed on my
system?
For MVC 4.0, MVC 5.0, or MVC 5.1 you should have deployed the
affected binary (System.Web.MVC.dll) with your application. Check your
application’s bin folder for the version of the binary. For MVC 2.0,
MVC 3.0, or MVC 4.0, refer to the Add or Remove Programs control panel
item for the version of MVC installed.
You can also check version of Microsoft.AspNet.Mvc nuget package installed in your project.
You can use Package Manager Console:
Get-Package Microsoft.AspNet.Mvc
This is another way of finding the MVC version for ASP net CORE projects by adding small code to your Home Controller. Hope this will be helpful.
Go to the Project Controller folder, open 'HomeController.cs' file. In HomeController.cs file, there is an Index Method with the return type of ActionResult/IActionResults. Just change the Method type from ActionResult to string and write the code, given below, into that method.
return typeof(Controller).Assembly.GetName().Version.ToString ();
Run your project, You can see the MVC version used in your project on the home page.
Use NuGet package MvcDiagnostics that you can install. Create an MVC "hello world" or some other basic program, then install this package. The installation will prompt for the project to add a file to. Confirm and you should see MvcDiagnostics.aspx added to your project. Right click on this file in the solution viewer, then choose "View in browser". You should then see a nice page with all your assembly information. Mine looks like the following:
Microsoft ASP.NET MVC Diagnostics Information
This page is designed to help diagnose common errors related to mismatched or conflicting ASP.NET MVC binaries. If a known issue is identified, it will be displayed below in red text.
For questions or problems with ASP.NET MVC or this utility, please visit the ASP.NET MVC forums at http://forums.asp.net/1146.aspx.
Environment Information
Operating system: Microsoft Windows NT 6.2.9200.0
.NET Framework version: 4.0.30319.34209 (32-bit)
Web server: Microsoft-IIS/8.0
Integrated pipeline: True
Worker process: iisexpress.exe
AppDomain: Homogenous = True, FullTrust = True
ASP.NET MVC Assembly Information (System.Web.Mvc.dll)
Assembly version: ASP.NET MVC 4 RTM (4.0.20710.0)
Full name: System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Code base: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Web.Mvc/v4.0_4.0.0.0__31bf3856ad364e35/System.Web.Mvc.dll
Deployment: GAC-deployed
ASP.NET MVC Futures Assembly Information (Microsoft.Web.Mvc.dll)
An ASP.NET MVC Futures assembly has not been loaded into this application. A download for this version of ASP.NET MVC Futures is not available. Pre-release versions of the MVC Futures assembly are no longer available once that version of ASP.NET MVC has gone RTM.
All Loaded Assemblies
71 assemblies are loaded.
A_65e81fd0_eb37_47d8_aba0_baece822c7ad, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Antlr3.Runtime, Version=3.3.1.7705, Culture=neutral, PublicKeyToken=31bf3856ad364e35
App_global.asax.1h_47vyd, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
App_Web_rnug5pva, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
BasicAuthentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.JScript, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.VisualBasic.Activities.Compiler, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.VisualStudio.Web.PageInspector.Runtime, Version=12.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.VisualStudio.Web.PageInspector.Tracing, Version=12.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
SMDiagnostics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Data.Services.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Data.SqlXml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Runtime.Caching, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Runtime.DurableInstancing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.ServiceModel.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.ServiceModel.Internals, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Web.Mobile, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Web.Optimization, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Web.RegularExpressions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Workflow.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Workflow.ComponentModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Workflow.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.WorkflowServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Xaml.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
WebGrease, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35