繁体   English   中英

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

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

我已经在Azure Web应用程序服务上部署了两个项目(Crestfine和CrestfineWebapp)。 但是,Web应用程序由于错误而无法运行

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

Crestfine这里是运行良好的Web API。 CrestfineWebapp引发此错误

装配负载跟踪:

   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]

堆栈跟踪:

[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

我已将Azure平台体系结构设置为64位 在此处输入图片说明

在本地,它们都可以通过以下设置正常运行 在此处输入图片说明

在此处输入图片说明

溶液对我的评论区发,很容易解决的博客

我继续在CrestfineWebApp中添加了CrestFine(Web api)引用,此外将平台目标更改为:

在此处输入图片说明

AnyCPU

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM