Quantcast
Channel: entityframework Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1793

New Post: EF6 startup performance

$
0
0
@Goran - the error
Error 3 Unknown build error, 'Cannot resolve dependency to assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.' MainWPFApplication 
seems to be related to how WPF processes Xaml. Apparently when compiling Xaml they try to load all the assemblies referenced by the project. However they fail to load EF6Performance.Data.dll since a dependent assembly (EntityFramework.dll) cannot be found. You can see what is happening if you run your build with the diagnostic verbosity - here is the interesting bit:
   (TaskId:106)
  Microsoft (R) Build Task 'MarkupCompilePass1' Version '4.0.30319.33440 built by: FX45W81RTMREL'. (TaskId:106)
  Copyright (C) Microsoft Corporation 2005. All rights reserved. (TaskId:106)
  
   (TaskId:106)
  Input: Markup ApplicationDefinition file: 'c:\Temp\EF6Performance\EF6Performance\EF6Performance.View\App.xaml'. (TaskId:106)
  Current project directory is 'c:\Temp\EF6Performance\EF6Performance\EF6Performance.View\'. (TaskId:106)
  Analysis Result : 'All'. (TaskId:106)
  Recompiled XAML file : 'c:\Temp\EF6Performance\EF6Performance\EF6Performance.View\MainWindow.xaml'. (TaskId:106)
  Started the markup compilation. (TaskId:106)
  OutputType is 'winexe'. (TaskId:106)
  Input: Assembly Reference file: 'c:\Temp\EF6Performance\EF6Performance\EF6Performance.Data\bin\Debug\EF6Performance.Data.dll'. (TaskId:106)
  Input: Assembly Reference file: 'c:\Temp\EF6Performance\EF6Performance\EF6Performance.ViewModel\bin\Debug\EF6Performance.ViewModel.dll'. (TaskId:106)
  Input: Assembly Reference file: 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\mscorlib.dll'. (TaskId:106)
  Input: Assembly Reference file: 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\PresentationCore.dll'. (TaskId:106)
  Input: Assembly Reference file: 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\PresentationFramework.dll'. (TaskId:106)
  Input: Assembly Reference file: 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.ComponentModel.DataAnnotations.dll'. (TaskId:106)
  Input: Assembly Reference file: 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Core.dll'. (TaskId:106)
  Input: Assembly Reference file: 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.dll'. (TaskId:106)
  Input: Assembly Reference file: 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Xaml.dll'. (TaskId:106)
  Input: Assembly Reference file: 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Xml.dll'. (TaskId:106)
  Input: Assembly Reference file: 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Xml.Linq.dll'. (TaskId:106)
  Input: Assembly Reference file: 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\WindowsBase.dll'. (TaskId:106)
C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets(268,9): error MC1000: Unknown build error, 'Cannot resolve dependency to assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.'  [c:\Temp\EF6Performance\EF6Performance\EF6Performance.View\EF6Performance.View.csproj]
Done executing task "MarkupCompilePass1" -- FAILED. (TaskId:106)
If you add a reference to the EntityFramework.dll the assembly will be dropped to the same folder where EF6Performance.Data.dll and therefore WPF will be able to find it. I wonder if your EF5 project is using DbContext or ObjectContext. If you are using ObjectContext then the explanation is that System.Data.Entity.dll is in the GAC and therefore is always accessible. If you are using DbContext then I don't know how it gets resolved.

There is actually a connect bug for this issue but it does not look like they are going to fix this.

Viewing all articles
Browse latest Browse all 1793

Trending Articles



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