I always get the following exceptions after my test has already completed, and the test runner is in the process of shutting down. Is this normal? I always feel rather concerned when I get a bunch of random exceptions..
The thread '' (0xc04) has exited with code 0 (0x0).
A first chance exception of type
'System.ComponentModel.Win32Exception' occurred in
System.ServiceModel.dll
A first chance exception of type
'System.Threading.ThreadAbortException' occurred in mscorlib.dll
System.Transactions Critical: 0 : http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/UnhandledUnhandled
exceptionvstest.executionengine.exeSystem.AppDomainUnloadedException,
mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089Attempted to
access an unloaded AppDomain.
System.AppDomainUnloadedException:
Attempted to access an unloaded
AppDomain.
The thread '' (0xdd8) has exited with code 0 (0x0).
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded
'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO
11.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\Extensions\CppUnitFramework\Microsoft.VisualStudio.TestTools.CppUnitTestFramework.TestEngine.dll'
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded
'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO
11.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\Extensions\CppUnitFramework\Microsoft.VisualStudio.TestTools.CppUnitTestFramework.Discoverer.dll'
The thread '' (0xa64) has exited with code 0 (0x0).
A first chance exception of type 'System.InvalidOperationException'
occurred in Microsoft.VisualStudio.TestPlatform.TestExecutor.Core.dll
A first chance exception of type
'System.ServiceModel.CommunicationObjectAbortedException' occurred in
System.ServiceModel.dll
etc.
Configuring DTC solved my problem.
http://www.devexpress.com/Support/Center/Question/Details/Q434480
Related
I am facing an issue with Visual Studio 2015. When I click on new project/add new file, I get an error message. I get this error even for clicking few menu items.
Set property 'System.Windows.ResourceDictionary.DeferrableContent' threw an exception.
I even get few more errors like:
The 'XamlDesignerPackage' package did not load correctly.
The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file 'C:\Users\MY PC\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml'.
Restarting Visual Studio could help resolve this issue.
I have tried repair and reinstall(uninstall and install again) both didn't have any effect.
These are the errors found in ActivityLog.xml
<entry>
<record>392</record>
<time>2018/02/09 02:11:35.915</time>
<type>Error</type>
<source>Extension Manager</source>
<description>Extension will not be loaded because an extension with the same ID 'Microsoft.Windows.DevelopmentKit.Desktop' is already loaded at C:\PROGRAM FILES (X86)\COMMON FILES\MICROSOFT\EXTENSIONMANAGER\EXTENSIONS\MICROSOFT\WINDOWS KITS\10\DESKTOP SDK\...</description>
<path>C:\PROGRAM FILES (X86)\COMMON FILES\MICROSOFT\EXTENSIONMANAGER\EXTENSIONS\MICROSOFT\WINDOWS KITS\8.1\DESKTOP SDK\</path>
<entry>
<record>400</record>
<time>2018/02/09 02:11:47.980</time>
<type>Error</type>
<source>Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost</source>
<description>Still unable to load MEF component DLL: Could not load file or assembly 'Microsoft.VisualStudio.Workspaces.Contracts, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Could not find or load a type. (Exception from HRESULT: 0x80131522)</description>
<path>C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\EXTENSIONS\HEXW0BB4.KCG\TMLanguage.dll</path>
<entry>
<record>420</record>
<time>2018/02/09 02:12:00.074</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [ServiceProviderPackage]Source: 'GitHub.VisualStudio' Description: Could not load type 'GitHub.Services.IUIProvider' from assembly 'GitHub.Exports, Version=2.4.2.1331, Culture=neutral, PublicKeyToken=bc1bd09f2901c82e'.
System.TypeLoadException: Could not load type 'GitHub.Services.IUIProvider' from assembly 'GitHub.Exports, Version=2.4.2.1331, Culture=neutral, PublicKeyToken=bc1bd09f2901c82e'.
at GitHub.VisualStudio.ServiceProviderPackage.InitializeAsync(CancellationToken cancellationToken, IProgress`1 progress)
at Microsoft.VisualStudio.Shell.AsyncPackage.<>c__DisplayClass16_0.<<Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e)
at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck)
at Microsoft.VisualStudio.Services.VsTask.GetResult()</description>
<guid>{D5CE1488-DEDE-426D-9E5B-BFCCFBE33E53}</guid>
<hr>80131522</hr>
<errorinfo></errorinfo>
And there are few more.
My solution consists of 3 projects:
My backend project with assembly My_Test_App (portable)
My_Test_App.Android
My_Test_App.iOS
I develop using VS2015 and use mac to build and deploy. It works fine in iOS simulator. My iOS project do not use linker. Also i have LLVM and incremental build already unchecked.
But when i tried to debug to iPhone device, i got this error:
Severity Code Description Project File Line Suppression State
Error Could not AOT the assembly/Users/myMacName/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Release/mtouch-cache/64/Build/My_Test_App.dll' My_Test_App.iOS
My question is:
How do you disable the AOT in the Xamarin.iOS project? When i check the csproj file of the iOS project, it does not have like in the droid project.
Is disabling the AOT the correct way to solve it?
Thank you for answering!
My build log:
1>------ Build started: Project: My_Test_App.Droid, Configuration: Debug Any CPU ------
2>------ Build started: Project: My_Test_App.iOS, Configuration: Debug iPhone ------
1> Consider app.config remapping of assembly "System.Runtime, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.0.0.0" [] to Version "4.1.0.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\System.Runtime.dll] to solve conflict and get rid of warning.
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file: <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Runtime" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /></dependentAssembly></assemblyBinding>
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
1> My_Test_App.Droid -> D:\Project\2017\Xamarin Test\test-mobile\My Test App\My_Test_App.Droid\bin\Debug\My_Test_App.Droid.dll
2> Generated session id: c7eaf4168fcb1f8aaecd3a6cbb0f37ee
2> Generated build app name: My_Test_App.iOS
2> Connecting to Mac server MTMAC22s-Mac-mini.local...
2> No way to resolve conflict between "System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System.Runtime.Serialization, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
2> Consider app.config remapping of assembly "System.Numerics, Culture=neutral, PublicKeyToken=b77a5c561934e089" from Version "2.0.5.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Xamarin.iOS\v1.0\System.Numerics.dll] to Version "4.0.0.0" [C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll] to solve conflict and get rid of warning.
2> Consider app.config remapping of assembly "System.Net.Http, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "1.5.0.0" [] to Version "4.0.0.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Xamarin.iOS\v1.0\System.Net.Http.dll] to solve conflict and get rid of warning.
2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3276: Found conflicts between different versions of the same dependent assembly. Please set the "AutoGenerateBindingRedirects" property to true in the project file. For more information, see http://go.microsoft.com/fwlink/?LinkId=294190.
2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>D:\Project\2017\Xamarin Test\test-mobile\My Test App\My_Test_App.iOS\Renderers\CustomLabelRenderer.cs(143,53,143,69): warning CS0618: 'Label.Font' is obsolete: 'Please use the Font attributes which are on the class itself. Obsoleted in v1.3.0'
2> My_Test_App.iOS -> D:\Project\2017\Xamarin Test\test-mobile\My Test App\My_Test_App.iOS\bin\iPhone\Debug\My_Test_AppiOS.exe
2> Detected signing identity:
2> Code Signing Key: "iPhone Developer: myemail#mycompany.com (HDZY35YSCS)" (6E0C54049FD692EBF4A54BBD72889DC336388268)
2> Provisioning Profile: "iOS Team Provisioning Profile: com.yourcompany.MyTestApp" (8f408fd0-90e0-4031-92e8-a6a56530778a)
2> Bundle Id: com.yourcompany.MyTestApp
2> App Id: F8AZP5FC9H.com.yourcompany.MyTestApp
2> Mono Ahead of Time compiler - compiling assembly /Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/64/Build/System.Net.Primitives.dll
2> AOTID BE85C9F7-62C4-0559-D329-FA98D6ECDAF2
2> Code: 0(0%) Info: 0(0%) Ex Info: 0(0%) Unwind Info: 0(0%) Class Info: 7(2%) PLT: 1(0%) GOT Info: 236(71%) Offsets: 86(26%) GOT: 120
2> Compiled: 0/0 (100%), No GOT slots: 0 (100%), Direct calls: 0 (100%)
2> Output file: '/Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/System.Net.Primitives.dll.arm64.s'.
2> Linking symbol: '_mono_aot_module_System_Net_Primitives_info'.
2> JIT time: 0 ms, Generation time: 0 ms, Assembly+Link time: 0 ms.
2> /Users/builder/data/lanes/3969/7beaef43/source/xamarin-macios/external/mono/eglib/src/ghashtable.c:549: assertion 'hash != NULL' failed
2> Mono Ahead of Time compiler - compiling assembly /Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/64/Build/System.Xml.ReaderWriter.dll
2> AOTID 77D080C4-2116-2E71-9BA1-0FB994D16E87
2> Code: 0(0%) Info: 0(0%) Ex Info: 0(0%) Unwind Info: 0(0%) Class Info: 7(2%) PLT: 1(0%) GOT Info: 236(71%) Offsets: 86(26%) GOT: 120
2> Compiled: 0/0 (100%), No GOT slots: 0 (100%), Direct calls: 0 (100%)
2> Output file: '/Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/System.Xml.ReaderWriter.dll.arm64.s'.
2> Linking symbol: '_mono_aot_module_System_Xml_ReaderWriter_info'.
2> JIT time: 0 ms, Generation time: 0 ms, Assembly+Link time: 0 ms.
2> /Users/builder/data/lanes/3969/7beaef43/source/xamarin-macios/external/mono/eglib/src/ghashtable.c:549: assertion 'hash != NULL' failed
2> Mono Ahead of Time compiler - compiling assembly /Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/64/Build/My_Test_AppiOS.exe
2> AOTID 298562A7-A350-2A44-1D0B-2E4FC728F9D1
2> Code: 54748(65%) Info: 456(0%) Ex Info: 19951(23%) Unwind Info: 1136(1%) Class Info: 4700(5%) PLT: 190(0%) GOT Info: 2018(2%) Offsets: 626(0%) GOT: 2872
2> Compiled: 97/97 (100%), No GOT slots: 0 (0%), Direct calls: 15 (37%)
2> Output file: '/Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/My_Test_AppiOS.exe.arm64.s'.
2> Linking symbol: '_mono_aot_module_My_Test_AppiOS_info'.
2> JIT time: 21 ms, Generation time: 25 ms, Assembly+Link time: 0 ms.
2> AOT Compilation exited with code 139, command:
2> MONO_PATH=/Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/64/Build /Library/Frameworks/Xamarin.iOS.framework/Versions/10.3.1.8/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt --aot=mtriple=arm64-ios,data-outfile=/Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/My_Test_App.arm64.aotdata,static,asmonly,direct-icalls,full,soft-debug,dwarfdebug,no-direct-calls,outfile=/Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/My_Test_App.dll.arm64.s "/Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/64/Build/My_Test_App.dll"
2>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(696,3): error : Could not AOT the assembly '/Users/mtmac22/Library/Caches/Xamarin/mtbs/builds/My_Test_App.iOS/c7eaf4168fcb1f8aaecd3a6cbb0f37ee/obj/iPhone/Debug/mtouch-cache/64/Build/My_Test_App.dll'
2> at Xamarin.Bundler.AOTTask.Build () [0x00117] in <e61e7c7e12a34f76bb60aae297cbc79c>:0
2> at Xamarin.Bundler.BuildTask.Execute () [0x00000] in <e61e7c7e12a34f76bb60aae297cbc79c>:0
2> at Xamarin.Bundler.BuildTasks.Execute (Xamarin.Bundler.BuildTask v) [0x00000] in <e61e7c7e12a34f76bb60aae297cbc79c>:0
2> at System.Threading.Tasks.Parallel+<ForEachWorker>c__AnonStorey6`2[TSource,TLocal].<>m__0 (System.Int32 i) [0x00012] in <8f2c484307284b51944a1a13a14c0266>:0
2> at System.Threading.Tasks.Parallel+<ForWorker>c__AnonStorey3`1[TLocal].<>m__1 () [0x000ed] in <8f2c484307284b51944a1a13a14c0266>:0
========== Build: 1 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
You cannot disable AOT on iOS, your project won't work as iDevices do not allow JIT'ing
No unfortunately no.
We'd need a longer build log (add '-v -v -v' as 'mtouch' arguments), but it can happen because the assembly is too big. you might want to enable Linking All Assemblies in the iOS project settings.
See this for additional references: https://forums.xamarin.com/discussion/457/error-could-not-aot-the-assembly-servicestack-text-monotouch-dll
I upgraded (clean install) from Win7+VS2012 to Win8+VS2012.
I ran into a problem just after that: When I try to run any project with the processor target AnyCPU or x86, vshost.exe crashes immediately after building and starting the project with an Access Violation. This behavior is not affected by changing the type of the project (console, winforms, wpf).
When I change the architecture to x64 however, debugging works just fine.
This is the output I get in the Debug output window if I start a new created console application:
'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll', Symbols loaded.
'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll', Symbols loaded.
'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll', Symbols loaded.
'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', Symbols loaded.
'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll', Symbols loaded.
'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll', Symbols loaded.
'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll'
'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'e:\Users\SeriTools\Documents\Visual Studio 2012\Projects\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.vshost.exe', Symbols loaded.
'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll', Symbols loaded.
'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll', Symbols loaded.
'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll', Symbols loaded.
'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll', Symbols loaded.
'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll', Symbols loaded.
'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll', Symbols loaded.
The thread 'vshost.NotifyLoad' (0x1068) has exited with code 0 (0x0).
The thread '<No Name>' (0x16c8) has exited with code 0 (0x0).
The thread '<No Name>' (0x1688) has exited with code 0 (0x0).
The thread 'vshost.LoadReference' (0x233c) has exited with code 0 (0x0).
'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'e:\users\seritools\documents\visual studio 2012\Projects\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.exe', Symbols loaded.
The program '[5088] ConsoleApplication2.vshost.exe: Program Trace' has exited with code 0 (0x0).
The program '[5088] ConsoleApplication2.vshost.exe: Managed (v4.0.30319)' has exited with code -1073741819 (0xc0000005) 'Access violation'.
What I tried to fix that:
Completely removed and reinstalled VS, checking if not applying Update 1 changes anything
devenv.exe /ResetSettings and uninstalling all plugins/add-ins
running VS as admin
Can someone help me with this problem?
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)
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.