get invalid exception - visual-studio-2010

System.InvalidOperationException was unhandled
Message=An error occurred creating the form. See Exception.InnerException for details. The error is: Could not load file or assembly 'Interop.WMPLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Source=kn diary
StackTrace:
at kn_diary.My.MyProject.MyForms.Create_Instance_[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at kn_diary.My.MyProject.MyForms.get_Form1()
at kn_diary.My.MyApplication.OnCreateMainForm() in C:\Users\Pak\Desktop\project\kn diary\kn diary\My Project\Application.Designer.vb:line 35
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at kn_diary.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.BadImageFormatException
Message=Could not load file or assembly 'Interop.WMPLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Source=AxInterop.WMPLib
FileName=Interop.WMPLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
FusionLog==== Pre-bind state information ===
LOG: User = Pak-PC\Pak
LOG: DisplayName = Interop.WMPLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Users/Pak/Desktop/project/kn diary/kn diary/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : AxInterop.WMPLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\Pak\Desktop\project\kn diary\kn diary\bin\Debug\kn diary.vshost.exe.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/Pak/Desktop/project/kn diary/kn diary/bin/Debug/Interop.WMPLib.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
StackTrace:
at AxWMPLib.AxWindowsMediaPlayer.AttachInterfaces()
at System.Windows.Forms.AxHost.GetOcxCreate()
at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
at System.Windows.Forms.AxHost.CreateHandle()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.AxHost.EndInit()
at kn_diary.Form1.InitializeComponent() in C:\Users\Pak\Desktop\project\kn diary\kn diary\Form1.designer.vb:line 91
at kn_diary.Form1..ctor()
InnerException:

This is an indication of failure to load one of the reference assemblies in the chain of references, in this case, an indirect reference. I normally check the fusion log to find out exactly what assembly is failing to load and often why.
Can you check the fusion log and paste the log here in case if you do not already spot the culprit there? You can lunch logger by running "fuslogvw.exe" from VS command prompt. (this link has more detail on how to use the fusion log viewer: http://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.80).aspx)

Related

'Oracle.DataAccess, Version=2.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies

I have a web project built in Visual Studio 2012. Its using the Oracle.DataAccess.dll
Now the one I see in my solution is 4.121 version. But am receiving this error where the project is looking for 2.122 version.
Thanks for your help in advance
Below is the stack trace
=== Pre-bind state information === LOG: DisplayName = Oracle.DataAccess, Version=2.122.1.0, Culture=neutral,
PublicKeyToken=89b483f429c47342 (Fully-specified) LOG: Appbase =
file:///C:/TFS/IVAS/CPTSBaselineCode/FrontEndApplications/CampaignPerformanceTracking/CampaignPerformanceTracking/
LOG: Initial PrivatePath =
C:\TFS\IVAS\CPTSBaselineCode\FrontEndApplications\CampaignPerformanceTracking\CampaignPerformanceTracking\bin
Calling assembly : Aarp.Cpts.DataObjects, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null.
=== LOG: This bind starts in default load context. LOG: Using application configuration file:
C:\TFS\IVAS\CPTSBaselineCode\FrontEndApplications\CampaignPerformanceTracking\CampaignPerformanceTracking\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: Oracle.DataAccess, Version=2.122.1.0,
Culture=neutral, PublicKeyToken=89b483f429c47342 LOG: Attempting
download of new URL
file:///C:/Users/XXX/AppData/Local/Temp/1/Temporary ASP.NET
Files/vs/ecf130a4/7d736bb0/Oracle.DataAccess.DLL. LOG: Attempting
download of new URL
file:///C:/Users/XXX/AppData/Local/Temp/1/Temporary ASP.NET
Files/vs/ecf130a4/7d736bb0/Oracle.DataAccess/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL
file:///C:/TFS/IVAS/CPTSBaselineCode/FrontEndApplications/CampaignPerformanceTracking/CampaignPerformanceTracking/bin/Oracle.DataAccess.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
'Oracle.DataAccess, Version=2.122.1.0, Culture=neutral,
PublicKeyToken=89b483f429c47342' or one of its dependencies. The
located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)]
CampaignPerformanceTracking.JobSearch..ctor() in
c:\TFS\IVAS\CPTSBaselineCode\FrontEndApplications\CampaignPerformanceTracking\CampaignPerformanceTracking\JobSearch.aspx.cs:25
ASP.jobsearch_aspx..ctor() in
c:\Users\XXX\AppData\Local\Temp\1\Temporary ASP.NET
Files\vs\ecf130a4\7d736bb0\App_Web_xghf0hzg.3.cs:0
__ASP.FastObjectFactory_app_web_xghf0hzg.Create_ASP_jobsearch_aspx() in c:\Users\XXX\AppData\Local\Temp\1\Temporary ASP.NET
Files\vs\ecf130a4\7d736bb0\App_Web_xghf0hzg.4.cs:0
System.Web.Compilation.BuildResultCompiledType.CreateInstance() +31
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath
virtualPath, Type requiredBaseType, HttpContext context, Boolean
allowCrossApp) +100
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context,
String requestType, VirtualPath virtualPath, String physicalPath) +31
System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext
context, String requestType, VirtualPath virtualPath, String
physicalPath) +64
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String
requestType, VirtualPath path, String pathTranslated, Boolean
useAppConfig) +191
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+156 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +48 System.Web.HttpApplication.ExecuteStep(IExecutionStep
step, Boolean& completedSynchronously) +159
It is a bit difficult to help you if we see only the error message and nothing else. Some points:
Which version of .NET framework did you set in your compile options? If you set 3.5 or lower then your application tries to load Oracle.DataAccess.dll 2.xxx. If you set 4.0 or higher then Oracle.DataAccess.dll 4.xxx will be loaded.
The architecture (i.e. 32-bit or 64-bit) of Oracle.DataAccess.dll must be the same as the architecture if your application
Did you install Oracle.DataAccess.dll (Oracle Data Provider for .NET)? - it is not included in Oracle Instant Client by default.
Version of Oracle.DataAccess.dll must be exactly the same version as your Oracle Client
Oracle installer 12.1 or newer does not add Oracle.DataAccess.dll to GAC. You must add it manually.

MQ client 8.0.0.4 type initializer error when called from ssis script task

While migrating from mq dot client 1.0 to mq 8.0.0.4, receiving following error when call mq manager is made.
call is made from a script task from ssis 2012 package. call to mq manager works when called from a windows service.
Inner Exception :
System.IO.FileLoadException: Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542)
File name: 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.IO.FileLoadException: Could not load file or assembly 'System.Web`enter code here`, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542)
File name: 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
=== Pre-bind state information ===
LOG: DisplayName = System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/Program Files/Microsoft SQL Server/110/DTS/Binn/
LOG: Initial PrivatePath = NULL
Calling assembly : amqmdnet, Version=9.0.0.3, Culture=neutral, PublicKeyToken=dd3cb1c9aae9ec97.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files\Microsoft SQL Server\110\DTS\Binn\DTExec.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Version redirect found in framework config: 2.0.0.0 redirected to 4.0.0.0.
LOG: Post-policy reference: System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
at IBM.WMQ.CommonServices.GetPropertyValue(String propertyName, Boolean tryEnvironment)
at IBM.WMQ.CommonServices.CreateCommonServices()
at IBM.WMQ.CommonServices.TraceConstructor(String objectId, String sccsid)
at IBM.WMQ.Nmqi.NmqiEnvironment..ctor(NmqiPropertyHandler nmqiPropertyHandler)
at IBM.WMQ.Nmqi.NmqiFactory.GetInstance(NmqiPropertyHandler properties)
at IBM.WMQ.MQQueueManager..cctor()
Stack Trace :
at IBM.WMQ.MQQueueManager..ctor(String queueManagerName, Hashtable properties)
at CIBC.CTS.PMI.MQ.MQConnection.Connect(String hostName, Int32 port, String queueManagerName, String channelName, String replyQueueManagerName, String mqIdentity)
Message :
The type initializer for 'IBM.WMQ.MQQueueManager' threw an exception.
Source :
amqmdnet
Edit: have tried installing version 9.0.0.3 too as 8.0.0.4 had know issue with unmanaged code calling mq, but that did not work.
could this issue be due to version redirector as per the binding log?
LOG: Version redirect found in framework config: 2.0.0.0 redirected to 4.0.0.0.
Or related to Impersonation from SSIS script task? Impersonaltion level is shown as "Identification"

Visual Studio 2013 random crashing

Random crashes have started since yesterday in VS2013 when I'm just navigating in the IDE, or editing a file, or debugging, or just plain doing nothing.
Its an MVC 5 project but has happened to another solution also. I'm on latest updates for VS2013, but don't think I've upgraded any major nuget packages recently. Have Atlassian plug-in for JIRA, web essentials but no updates to these recently either.
I can probably move these solutions now to VS2015, which doesn't seem to give me the issue, so I can workaround it. Just need to get the rest of the company upgraded.
Only logs I can find are in EventViewer, showing 2 entries per crash.
Any other logs that can help pinpoint what's failing?
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponse(System.Net.Http.HttpResponseMessage)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase+<SendAsync>d__a.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase+<SendAsync>d__2`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient+<GetConnectionDataAsync>d__2.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
at Microsoft.VisualStudio.Services.Client.VssServerDataProvider+<ConnectAsync>d__5.MoveNext()
Exception Info: System.AggregateException
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean)
at System.Threading.Tasks.Task.Wait(Int32, System.Threading.CancellationToken)
at Microsoft.VisualStudio.Services.Client.VssServerDataProvider.CheckForServerUpdates()
at Microsoft.VisualStudio.Services.Client.VssServerDataProvider.FindServiceDefinition(System.String, System.Guid, System.Guid)
at Microsoft.VisualStudio.Services.Client.VssServerDataProvider.LocationForCurrentConnection(System.String, System.Guid, System.Guid)
at Microsoft.VisualStudio.Services.Client.VssServerDataProvider.<GetRemoteDataProvider>b__d(System.Guid)
at System.Collections.Concurrent.ConcurrentDictionary`2[[System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].GetOrAdd(System.Guid, System.Func`2<System.Guid,System.__Canon>)
at Microsoft.VisualStudio.Services.Client.VssServerDataProvider.GetRemoteDataProvider(System.Guid)
at Microsoft.VisualStudio.Services.Client.VssServerDataProvider.LocationForCurrentConnection(System.String, System.Guid, System.Guid)
at Microsoft.VisualStudio.Services.Client.VssConnection.GetClientInstance(System.Type, Microsoft.VisualStudio.Services.Common.VssHttpRequestSettings, System.Net.Http.DelegatingHandler[])
at Microsoft.VisualStudio.Services.Client.VssConnection.GetClientInstance(System.Type)
at Microsoft.VisualStudio.Services.Client.VssConnection.GetClientServiceImpl(System.Type, System.Func`2<System.Type,System.Object>)
at Microsoft.VisualStudio.Services.Client.VssConnection.GetClientServiceImpl[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Func`2<System.Type,System.Object>)
at Microsoft.VisualStudio.Services.Client.VssConnection.GetClient[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]()
at Microsoft.VisualStudio.Shell.Connected.ConnectedUser.VssConnectionWrapper.GetClient[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]()
at Microsoft.VisualStudio.Shell.Connected.ConnectedUser.BaseUserSession+<Microsoft.VisualStudio.Shell.Connected.ConnectedUser.IOnlineLicensingSupport.GetEncodedClientRightsAsync>d__25.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
at Microsoft.VisualStudio.Shell.Connected.ConnectedUser.VsOnlineLicensing+<RefreshClientRightsImplAsync>d__e.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
at Microsoft.VisualStudio.Shell.Connected.ConnectedUser.VsOnlineLicensing+<RefreshClientRightsOrPiggybackAsync>d__7.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
at Microsoft.VisualStudio.Shell.Connected.ConnectedUser.VsOnlineLicensing+<PollForClientRights>d__16.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
at Microsoft.VisualStudio.Shell.Connected.ConnectedUser.Poller+<PollAsync>d__3.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_1(System.Object)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
and this one;
Faulting application name: devenv.exe, version: 12.0.40629.0, time stamp: 0x5590c8a4
Faulting module name: KERNELBASE.dll, version: 6.1.7601.19110, time stamp: 0x56842600
Exception code: 0xe0434352
Fault offset: 0x0000c42d
Faulting process id: 0x1e30
Faulting application start time: 0x01d15f427bb58f14
Faulting application path: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe
Faulting module path: C:\Windows\syswow64\KERNELBASE.dll
Report Id: 246fd811-cb37-11e5-af51-bc305bdf85ce

Missing assemblies after migrating Silverlight 4 application to visual studio 2013 Silverlight 5

We are migrating a Silverlight4 application developed in visual studio 2010 with active directory single sign on to Silverlight 5 for visual studio 2013.
After replacing some .dll's like toolkit and data visualization toolkit and other dll without changing the framework(4.0) it was working fine but When I am changing the active directory project framework from 3.5 to 4.0 or higher it is throwing the following errors:
Error 71 The type name 'RoleProvider' could not be found. This type has been forwarded to assembly 'System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Consider adding a reference to that assembly.
Error 73 The type name 'MembershipUser' could not be found. This type has been forwarded to assembly 'System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Consider adding a reference to that assembly.
Error 74 The type name 'MembershipUser' could not be found. This type has been forwarded to assembly 'System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Consider adding a reference to that assembly.
Error 75 The type name 'MembershipUser' could not be found. This type has been forwarded to assembly 'System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Consider adding a reference to that assembly.
Error 76 The type name 'MembershipUser' could not be found. This type has been forwarded to assembly 'System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Consider adding a reference to that assembly.
Error 78 The type name 'MembershipUser' could not be found. This type has been forwarded to assembly 'System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Consider adding a reference to that assembly.
Error 77 The type name 'MembershipCreateStatus' could not be found. This type has been forwarded to assembly 'System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Consider adding a reference to that assembly.
Error 72 The type 'System.Web.Security.MembershipProvider' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
I tried replacing the assemblies and namespaces but no luck. Does anyone came across this kind of issues. I would appreciate your help if you could give me a solution. thank you very much
remove the existing reference to System.Web.ApplicationServices.dll and refer System.Web.ApplicationServices with version 4.0.0.0.. or higher
You can find it in a folder that might look like C:\Windows\Microsoft.NET\Framework64\v4.0.30319

Assembly Binding Old Reference Exception

I have been trying to solve an assembly binding issue for the last 12 hours, with not much luck. Last week, I had upgraded all of the projects in a solution from EF 4.1.0.0 to EF 4.3.1.0. I added some tests this morning to an existing test project, cleaned and recompiled the solution. All the projects compile with no warnings or errors. At my entity framework call anywhere in the project, I receive the following exception:
Initialization method
NutricityPPCTests.Common.DizzleProductExtensionsTests.TestSetup threw
exception. System.IO.FileLoadException: System.IO.FileLoadException:
Could not load file or assembly 'EntityFramework, Version=4.1.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040).
I fired up the fusion assembly binding log viewer, and found the log entry that corresponds to the exception. I have verified that my test project, the MOMData project both are referencing the correct EF4.3.1.0 assembly. I verified there were no references to EF 4.1.0.0 in the project files. I deleted the contents of the obj and bin directories in both projects. The project has been cleaned and rebuilt so many times, that my hard drive is probably going to give out tomorrow.
*** Assembly Binder Log Entry (3/22/2012 # 5:55:11 PM) ***
The operation failed.
Bind result: hr = 0x80131040. No description available.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable c:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\QTAgent32.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = NUTRICITY0\awolske
LOG: DisplayName = EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
(Fully-specified)
LOG: Appbase = file:///C:/Users/awolske/Documents/NutricityWorkspace/Nutricity/NutricityPPCTests/bin/Release
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = QTAgent32.exe
Calling assembly : MomData, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\awolske\Documents\NutricityWorkspace\Nutricity\NutricityPPCTests\bin\Release\NutricityPPCTests.DLL.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: EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Users/awolske/Documents/NutricityWorkspace/Nutricity/NutricityPPCTests/bin/Release/EntityFramework.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Users\awolske\Documents\NutricityWorkspace\Nutricity\NutricityPPCTests\bin\Release\EntityFramework.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: The assembly reference did not match the assembly definition found.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Where else should I be looking for the old referenced assembly?!? Any help would be welcome, and greatly appreciated! Thanks in advance for your time!
Add the following to your web.config file:
<runtime>
<assemblyBinding>
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
I had the same error. Most of the projects in my solution where referencing the Entity Framework 4.3.0.0 dll, but when I checked the references for all the projects in my solution, I found some projects referencing the Entity Framework 4.1.0.0 dll. Removing and replacing them with new references to the Entity Framework 4.3.0.0 dll fixed the problem.

Resources