0

我们正在使用 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

4

0 回答 0