無法在“EntityFramework”已存在的情況下建立影像複製該檔案的解決方案

weixin_34119545發表於2015-05-08

問題產生的原因:你專案正在生成中你就開啟瀏覽器預覽了,導致這個問題
解決方案:右擊重新生成專案,等生成後再開啟


“/”應用程式中的伺服器錯誤。

無法在“EntityFramework”已存在的情況下建立/影像複製該檔案。

說明: 執行當前 Web 請求期間,出現未經處理的異常。請檢查堆疊跟蹤資訊,以瞭解有關該錯誤以及程式碼中導致錯誤的出處的詳細資訊。

異常詳細資訊: System.IO.FileLoadException: 無法在“EntityFramework”已存在的情況下建立/影像複製該檔案。

源錯誤:

執行當前 Web 請求期間生成了未經處理的異常。可以使用下面的異常堆疊跟蹤資訊確定有關異常原因和發生位置的資訊。

程式集載入跟蹤: 下列資訊有助於確定程式集“EntityFramework”未能載入的原因。


=== 預繫結狀態資訊 ===
日誌: DisplayName = EntityFramework
(Partial)
警告: 為程式集提供了部分繫結資訊:
警告: 程式集名稱: EntityFramework | 域 ID: 2
警告: 當僅提供程式集顯示名稱的一部分時,將發生部分繫結。
警告: 這可能導致聯程式設計序載入錯誤的程式集。
警告: 建議為程式集提供完全指定的文字標識,
警告: 並由簡單名稱、版本、區域性和公鑰標記組成。
警告: 有關此問題的詳細資訊和常見解決方案,請參見白皮書 http://go.microsoft.com/fwlink/?LinkId=109270。
日誌: Appbase = file:///C:/Users/DNT/Desktop/LoTCode/LoTBlog/LoTBlog.Back/
日誌: 初始 PrivatePath = C:\Users\DNT\Desktop\LoTCode\LoTBlog\LoTBlog.Back\bin
呼叫程式集: (Unknown)。
===
日誌: 此繫結從 default 載入上下文開始。
日誌: 正在使用應用程式配置檔案: C:\Users\DNT\Desktop\LoTCode\LoTBlog\LoTBlog.Back\web.config
日誌: 使用主機配置檔案: C:\Users\DNT\Documents\IISExpress\config\aspnet.config
日誌: 使用 C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config 的計算機配置檔案。
日誌: 此時沒有為引用應用策略(私有、自定義、分部或基於位置的程式集繫結)。
日誌: 嘗試下載新的 URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/c3d58240/a41cf0bf/EntityFramework.DLL。
日誌: 嘗試下載新的 URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/c3d58240/a41cf0bf/EntityFramework/EntityFramework.DLL。
日誌: 嘗試下載新的 URL file:///C:/Users/DNT/Desktop/LoTCode/LoTBlog/LoTBlog.Back/bin/EntityFramework.DLL。
日誌: 正在使用應用程式配置檔案: C:\Users\DNT\Desktop\LoTCode\LoTBlog\LoTBlog.Back\web.config
日誌: 使用主機配置檔案: C:\Users\DNT\Documents\IISExpress\config\aspnet.config
日誌: 使用 C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config 的計算機配置檔案。
日誌: 策略後引用: EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
錯誤: 未能完成程式集的安裝(hr = 0x800700b7)。探測終止。

堆疊跟蹤:


[FileLoadException: 無法在“EntityFramework”已存在的情況下建立/影像複製該檔案。]

[FileLoadException: 無法在“EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”已存在的情況下建立/影像複製該檔案。]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +34
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +16
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38

[ConfigurationErrorsException: 無法在“EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”已存在的情況下建立/影像複製該檔案。]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +736
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +91
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +284
System.Web.Compilation.BuildManager.ExecutePreAppStart() +153
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516

[HttpException (0x80004005): 無法在“EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”已存在的情況下建立/影像複製該檔案。]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9885044
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

版本資訊: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.34009

相關文章