Не удалось загрузить файл или сборку 'XXX' или одну из ее зависимостей. Указанный модуль не может быть найден - PullRequest
0 голосов
/ 23 октября 2019

У меня запущен экземпляр WebAPI на сервере. Версия IIS на сервере 8.5. enter image description here

Теперь я пытаюсь развернуть этот же экземпляр на Docker. Содержимое моего Dockerfile:

FROM microsoft/aspnet
ARG source
WORKDIR C:/inetpub/wwwroot/
COPY . ./

Я могу создать образ и запустить его контейнер. Когда я пытаюсь получить доступ к тому же экземпляру WebAPI из запущенного контейнера. Я получаю следующую ошибку:

Could not load file or assembly 'XXX.DLL' or one of its 
dependencies. The specified module could not be found.
Description: An unhandled exception occurred during the execution of the 
current web request. Please review the stack trace for more information 
about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or 
assembly 'XXX.DLL' or one of its dependencies. The specified 
module could not be found.

Source Error:

An unhandled exception was generated during the execution of the current web 
request. Information regarding the origin and location of the exception can 
be identified using the exception stack trace below.

Stack Trace:


[FileNotFoundException: Could not load file or assembly 'XXX.DLL' 
or one of its dependencies. The specified module could not be found.]
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) +37
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName 
assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, 
StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean 
throwOnFileNotFound, Boolean forIntrospection, Boolean 
suppressSecurityChecks) +159
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, 
Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr 
pPrivHostBinder, Boolean forIntrospection) +80
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, 
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean 
forIntrospection) +22
System.Reflection.Assembly.Load(String assemblyString) +29
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String 
assemblyName, Boolean starDirective) +38

[ConfigurationErrorsException: Could not load file or assembly 
'XXX.DLL' or one of its dependencies. The specified module could 
not be found.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String 
assemblyName, Boolean starDirective) +726

...

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET 
Version:4.8.3752.0

Все мои зависимости находятся в папке bin. И я развертываю ту же папку bin в Docker-контейнере, что и на сервере.

...