简体   繁体   English

无法加载文件或程序集“ XXX”或其依赖项之一。 该系统找不到指定的文件

[英]Could not load file or assembly 'XXX' or one of its dependencies. The system cannot find the file specified

I have two projects (Crestfine and CrestfineWebapp) that i have deployed on Azure Web app service. 我已经在Azure Web应用程序服务上部署了两个项目(Crestfine和CrestfineWebapp)。 However the Web app fails to run citing an error 但是,Web应用程序由于错误而无法运行

   Could not load file or assembly 'crestfine' or one of its dependencies. The system cannot find the file specified. 

Crestfine here being web API which runs fine. Crestfine这里是运行良好的Web API。 CrestfineWebapp throws this error CrestfineWebapp引发此错误

Assembly Load Trace: 装配负载跟踪:

   WRN: Assembly binding logging is turned OFF.
   To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
   Note: There is some performance penalty associated with assembly bind failure logging.
   To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]

Stack Trace: 堆栈跟踪:

[FileNotFoundException: Could not load file or assembly 'crestfine' or one of its dependencies. The system cannot find the file specified.]
   System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
   System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +95
   System.Type.GetType(String typeName, Boolean throwOnError) +63
   System.Data.Entity.Internal.InitializerConfig.TryGetInitializer(Type requiredContextType, String contextTypeName, String initializerTypeName, Boolean isDisabled, Func`1 initializerArgs, Func`3 exceptionMessage) +46

[InvalidOperationException: Failed to set database initializer of type 'System.Data.Entity.MigrateDatabaseToLatestVersion`2[[crestfine.DAL.CrestfineContext, crestfine], [crestfine.Migrations.Configuration, crestfine]], EntityFramework, PublicKeyToken=b77a5c561934e089' for DbContext type 'crestfine.DAL.CrestfineContext, crestfine' specified in the application configuration. See inner exception for details.]
System.Data.Entity.Internal.InitializerConfig.TryGetInitializer(Type requiredContextType, String contextTypeName, String initializerTypeName, Boolean isDisabled, Func`1 initializerArgs, Func`3 exceptionMessage) +326
 System.Data.Entity.Internal.<>c__DisplayClass6.<TryGetInitializerFromEntityFrameworkSection>b__1(ContextElement e) +276
 System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +223
 System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source, Func`2 predicate) +115
 System.Data.Entity.Internal.InitializerConfig.TryGetInitializer(Type contextType) +23
 System.Data.Entity.Infrastructure.DependencyResolution.AppConfigDependencyResolver.GetServiceFactory(Type type, String name) +534
 System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) +84
System.Data.Entity.Infrastructure.DependencyResolution.AppConfigDependencyResolver.GetService(Type type, Object key) +187
 System.Linq.WhereSelectArrayIterator`2.MoveNext() +75
 System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source, Func`2 predicate) +115
System.Data.Entity.Infrastructure.DependencyResolution.CompositeResolver`2.GetService(Type type, Object key) +41
System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() +159
  System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input) +174
System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action) +269
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +38
  System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +77
  System.Data.Entity.Internal.Linq.InternalSet`1.GetAsyncEnumerator() +21
System.Data.Entity.Infrastructure.IDbAsyncEnumerableExtensions.ForEachAsync(IDbAsyncEnumerable`1 source, Action`1 action, CancellationToken cancellationToken) +69
System.Data.Entity.Infrastructure.IDbAsyncEnumerableExtensions.ToListAsync(IDbAsyncEnumerable`1 source, CancellationToken cancellationToken) +315

I've set the Azure Platform architecture to 64bit 我已将Azure平台体系结构设置为64位 在此处输入图片说明

Locally they both run fine with the following settings 在本地,它们都可以通过以下设置正常运行 在此处输入图片说明

在此处输入图片说明

A solution was sent on my comment section, pretty easy to solve Blog 溶液对我的评论区发,很容易解决的博客

I went ahead an added the CrestFine (web api) reference to the CrestfineWebApp.In addition I changed the platform target to: 我继续在CrestfineWebApp中添加了CrestFine(Web api)引用,此外将平台目标更改为:

在此处输入图片说明

from

AnyCPU

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “无法加载文件或程序集&#39;XXX.YYY&#39;或其依赖项之一。 该系统找不到指定的文件。” - “Could not load file or assembly 'XXX.YYY' or one of its dependencies. The system cannot find the file specified.” 无法加载文件或程序集的“扩展名”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'Extensions' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“ Ajax”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'Ajax' or one of its dependencies. The system cannot find the file specified 具体:无法加载文件或程序集“xxxx”或其依赖项之一。 该系统找不到指定的文件 - A specific: Could not load file or assembly 'xxxx' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“路径”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly "path" or one of its dependencies. The system cannot find the file specified XamlParseException:无法加载文件或程序集“ ResourceLibrary,...”或其依赖项之一。 该系统找不到指定的文件 - XamlParseException: Could not load file or assembly 'ResourceLibrary, …' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集或其依赖项之一。该系统找不到指定的文件 - Could not load file or assembly or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集或其依赖项之一。 该系统找不到指定的文件。 (不允许GAC) - Could not load file or assembly or one of its dependencies. The system cannot find the file specified. (No GAC allowed) 无法加载文件或程序集“ServiceStack”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'ServiceStack' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“Logging.SNLLoggingStandard3”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'Logging.SNLLoggingStandard3' or one of its dependencies. The system cannot find the file specified
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM