Почему библиотека, сгенерированная Costura.Fody, требует DLL, которая была включена внутри? - PullRequest
0 голосов
/ 10 января 2020

Мы используем Costura.Fody, чтобы упаковать все наши двоичные файлы в одну DLL. У него есть решение VS с одним проектом, и мы упаковываем в него все его зависимости. Пока этот проект был единственным в рамках решения, он работал. Но недавно мы перенесли некоторые функции в другой проект. С тех пор библиотека не может загружаться с System.Reflection.Assembly.LoadFrom, выдавая следующую ошибку:

System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

=== LOADER EXCEPTIONS ===
System.IO.FileNotFoundException:
---
System.IO.FileNotFoundException: Could not load file or assembly 'OurCompany.OurProject.TheLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'OurCompany.OurProject.TheLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

=== Pre-bind state information ===
LOG: DisplayName = OurCompany.OurProject.TheLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
 (Fully-specified)
LOG: Appbase = file:///C:/Work/Test/LibraryExplorer.Cli/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : OurCompany.OurProject, Version=1.0.62.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\Work\Test\LibraryExplorer.Cli\bin\Debug\LibraryExplorer.Cli.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Work/Test/LibraryExplorer.Cli/bin/Debug/OurCompany.OurProject.TheLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Work/Test/LibraryExplorer.Cli/bin/Debug/OurCompany.OurProject.TheLibrary/OurCompany.OurProject.TheLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Work/Test/LibraryExplorer.Cli/bin/Debug/OurCompany.OurProject.TheLibrary.EXE.
LOG: Attempting download of new URL file:///C:/Work/Test/LibraryExplorer.Cli/bin/Debug/OurCompany.OurProject.TheLibrary/OurCompany.OurProject.TheLibrary.EXE.
LOG: Attempting download of new URL file:///C:/Users/dominik.janata/AppData/Local/Temp/ProjectClock/OurCompany.OurProject.TheLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Users/dominik.janata/AppData/Local/Temp/ProjectClock/OurCompany.OurProject.TheLibrary/OurCompany.OurProject.TheLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Users/dominik.janata/AppData/Local/Temp/ProjectClock/OurCompany.OurProject.TheLibrary.EXE.
LOG: Attempting download of new URL file:///C:/Users/dominik.janata/AppData/Local/Temp/ProjectClock/OurCompany.OurProject.TheLibrary/OurCompany.OurProject.TheLibrary.EXE.

Чтобы устранить очевидное предположение, OurCompany.OurProject.TheLibrary.DLL упаковано среди ресурсов OurCompany.OurProject.DLL

...