C# - 'Resources' DLL 无法加载,因为它不存在 - 我如何找到引用以便我可以删除它?

Cit*_*iew 5 c# dll assembly-resolution

我有一个 C# 解决方案,它在编译时吐出一个可执行的二进制文件。二进制文件依赖于一个库,它是我编写的另一个解决方案的产物,所有相关代码都是我创建的。

最近,我以一种相当随意的方式尝试了许多项目设置,试图了解 CLR 构建链接的工作原理。不幸的是(可预见的?)我设法打破了我的二进制文件的链接,但我不知道如何解决这个问题。

  • 当我使用二进制文件时,我会在应用程序崩溃之前收到以下反馈

正在加载程序集........无法在程序集 MY.Library 中添加类型,版本 = 1.0.0.0,文化 = 中性,PublicKeyToken = null - 无法加载一种或多种请求的类型。检索 LoaderExceptions 属性以获取更多信息

  • MY.Library.resources DLL 的融合日志如下。提到的二进制文件不存在,我不知道它在哪里或为什么要加载。

>

All probing URLs attempted and failed

*** Assembly Binder Log Entry  (22/04/2011 @ 10:34:17) ***

The operation failed. Bind result: hr
= 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll Running under executable  G:\SVN\dev\Debug\MYExecutable.exe
--- A detailed error log follows. 

=== Pre-bind state information === LOG: User = UBERIT\gavina LOG: DisplayName = MY.Library.resources, Version=1.0.0.0, Culture=en, PublicKeyToken=null  (Fully-specified) LOG: Appbase = file:///G:/SVN/dev/Debug LOG: Initial PrivatePath = x64 LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = MYExecutable.exe Calling assembly : MY.Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
=== LOG: This bind starts in default load context. 
LOG: Using application configuration file: G:\BuildSVN\apps\ExecSys\MYExecutable\dev\Debug\MYExecutable.exe.Config LOG: Using host configuration file:  LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\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:///G:/SVN/dev/Debug/en/MY.Library.resources.DLL. 
LOG: Attempting download of new URL file:///G:/SVN/dev/Debug/en/MY.Library.resources/MY.Library.resources.DLL. 
LOG: Attempting download of new URL file:///G:/SVN/dev/Debug/x64/en/MY.Library.resources.DLL. 
LOG: Attempting download of new URL file:///G:/SVN/dev/Debug/x64/en/MY.Library.resources/MY.Library.resources.DLL. 
LOG: Attempting download of new URL file:///G:/SVN/dev/Debug/en/MY.Library.resources.EXE. LOG: Attempting download of new URL file:///G:/SVN/dev/Debug/en/MY.Library.resources/MY.Library.resources.EXE. 
LOG: Attempting download of new URL file:///G:/SVN/dev/Debug/x64/en/MY.Library.resources.EXE. 
LOG: Attempting download of new URL file:///G:/SVN/dev/Debug/x64/en/MY.Library.resources/MY.Library.resources.EXE. 
LOG: All probing URLs attempted and failed.
Run Code Online (Sandbox Code Playgroud)
  • “资源”DLL 是隐式的吗?或者我一定要引用这个 DLL?我应该如何在 SLN 中找到图书馆的参考资料?

TL; 博士

  • 如何删除对不存在的资源 DLL 的引用?

Emm*_*uel 0

通常,您引用的 DLL 应该位于ReferencesC# 项目的文件夹中(您还应该从那里添加外部 DLL)。您可以右键单击要踢出的 DLL,然后单击Remove