Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Commented Task: Web deploy (asp.net) depends on Designer's EF.dll [1183]

$
0
0
This bug is to track on our end that this gets fixed after vspreview. We can't have other products relying on the Common7\IDE\EntityFramework.dll that ships with the designer.
Comments: I just hit what I believe is the same issue. The problem is that there are two EntityFramework.dll assemblies (the same version) loaded to the same AppDomain. In my case ```AppDomain.CurrentDomain.GetAssemblies()``` returns this this: ``` ... EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 C:\Users\xxxxx\AppData\Local\assembly\dl3\XOAZ7OEV.3LX\KTMG7R30.2XP\58ff8352\916c9ade_af98ce01\EntityFramework.dll ... EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\EntityFramework.dll ... ``` I checked the Fusion log and this is what it showed: ``` *** Assembly Binder Log Entry (8/13/2013 @ 11:25:04 PM) *** The operation was successful. Bind result: hr = 0x0. The operation completed successfully. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under executable C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe --- A detailed error log follows. === Pre-bind state information === LOG: User = YYYYYY\xxxxxx LOG: DisplayName = EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 (Fully-specified) LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = devenv.exe Calling assembly : (Unknown). === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Users\xxxxxx\AppData\Local\Microsoft\VisualStudio\11.0\devenv.exe.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=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 LOG: GAC Lookup was unsuccessful. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/EntityFramework.DLL. LOG: Assembly download was successful. Attempting setup of file: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\EntityFramework.dll LOG: Entering run-from-source setup phase. LOG: Assembly Name is: EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 LOG: Binding succeeds. Returns assembly from C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\EntityFramework.dll. LOG: Assembly is loaded in default load context. WRN: The same assembly was loaded into multiple contexts of an application domain: WRN: Context: Default | Domain ID: 2 | Assembly Name: EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 WRN: Context: LoadFrom | Domain ID: 2 | Assembly Name: EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 WRN: This might lead to runtime failures. WRN: It is recommended to inspect your application on whether this is intentional or not. WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue. *** Assembly Binder Log Entry (8/13/2013 @ 11:25:04 PM) *** The operation was successful. Bind result: hr = 0x0. The operation completed successfully. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under executable C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe --- A detailed error log follows. === Pre-bind state information === LOG: User = YYYYYY\xxxxxx LOG: DisplayName = EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 (Fully-specified) LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = devenv.exe Calling assembly : ViewGenTestRTM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. === LOG: This bind starts in LoadFrom load context. WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load(). LOG: Using application configuration file: C:\Users\xxxxxx\AppData\Local\Microsoft\VisualStudio\11.0\devenv.exe.config LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Binding succeeds. Returns assembly from C:\Users\xxxxxx\AppData\Local\assembly\dl3\XOAZ7OEV.3LX\KTMG7R30.2XP\58ff8352\916c9ade_af98ce01\EntityFramework.dll. LOG: Assembly is loaded in LoadFrom load context. WRN: The same assembly was loaded into multiple contexts of an application domain: WRN: Context: Default | Domain ID: 2 | Assembly Name: EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 WRN: Context: LoadFrom | Domain ID: 2 | Assembly Name: EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 WRN: This might lead to runtime failures. WRN: It is recommended to inspect your application on whether this is intentional or not. WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue. ``` If you look carefully you will find that the first assembly was loaded in the default context: LOG: Assembly is loaded in default load context. while the second assembly was loaded in the LoadFrom context LOG: Assembly is loaded in LoadFrom load context. There is also a warning about this: WRN: The same assembly was loaded into __multiple contexts__ of an application domain: WRN: Context: Default | Domain ID: 2 | Assembly Name: EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 WRN: Context: LoadFrom | Domain ID: 2 | Assembly Name: EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 WRN: This might lead to runtime failures. WRN: It is recommended to inspect your application on whether this is intentional or not. WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue. [This blog post](http://www.example.com) shows differences between the contexts. Apparently if you have assemblies from different contexts the one loaded in the default context is preferred and will be used by default unless you load the type from the other assembly explicitly (which I think can only be done dynamically). In my case I wanted to new up the DbContext derived type defined by the user using Activator.CreateInstance and cast it to DbContext. However the cast failed (InvalidCastException) since the user DbContext derived type was derived from the DbContext from the assembly loaded in the LoadFrom context but the DbContext type I wanted to cast to was the one from the assembly loaded in the Load context.

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>