C# 为什么Costura.Fody生成的库需要包含在其中的DLL?

C# 为什么Costura.Fody生成的库需要包含在其中的DLL?,c#,.net,dll,dynamic-linking,fody-costura,C#,.net,Dll,Dynamic Linking,Fody Costura,我们正在使用Costura.Fody将所有二进制文件打包到一个DLL中。它有一个带有单个项目的VS解决方案,我们将其所有依赖项打包到该解决方案中。只要这个项目在解决方案中是单一的,它就可以工作。但最近我们将一些功能转移到了另一个项目中。此后,库无法使用System.Reflection.Assembly.LoadFrom加载,引发以下错误: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of t

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

新项目的DLL是否位于第一个项目bin文件夹中?您应该使用菜单Add Existing:将新项目添加到原始项目中,然后浏览到新项目bin文件夹。这两个项目都设置为调试(而不是发布)?DLL甚至包含在生成的“大”DLL中。您是否对所有项目进行了干净的构建?检查项目bin文件夹中所有文件的时间戳,并确保时间戳在重新组织项目之后。我怀疑一个文件没有更新。