0

在我解释实际问题之前,在一段未知的时间里,VS2010 没有设置为在 CLR 异常上中断。直到最近我在使用该应用程序时发现错误时才注意到这一点。这个选项是如何被关闭的对我来说是个谜。这可能与以下内容相关,也可能不相关。

现在我已经抛出了 CLR 异常,下面的详细异常会在以下位置停止 VS2010:

  using (UnitOfWork uow22 = new UnitOfWork())
  {
    bool useWebInt = uow22.Query<MCCommon.Web>().Where(o => o.Enabled == true).Select(o => o.OfflineEnabled).FirstOrDefault(); // <--- causes the exception
    enabled = useWebInt;
  }

DevExpress 的任何用户都会识别 XPO UnitOfWork 并知道它包含在 DevEx dll 中。MCCommon.Web 对象包含在项目中正确引用的 dll 中。MCCommon 和 MCCommon.Web 没有对 MyCourtsAdmin 的引用。

以下是上述代码段产生的错误:

System.IO.FileNotFoundException occurred
  Message=Could not load file or assembly 'MyCourtsAdmin' or one of its dependencies. The system cannot find the file specified.
  Source=mscorlib
  FileName=MyCourtsAdmin
  FusionLog==== Pre-bind state information ===
LOG: User = KATOOMBA\Administrator
LOG: DisplayName = MyCourtsAdmin
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: MyCourtsAdmin | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Users/Administrator/Documents/My Projects/MyCourts/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : DevExpress.Data.v11.2, Version=11.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\Administrator\Documents\My Projects\MyCourts\bin\Debug\MyCourts.vshost.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:///C:/Users/Administrator/Documents/My Projects/MyCourts/bin/Debug/MyCourtsAdmin.DLL.
LOG: Attempting download of new URL file:///C:/Users/Administrator/Documents/My Projects/MyCourts/bin/Debug/MyCourtsAdmin/MyCourtsAdmin.DLL.
LOG: Attempting download of new URL file:///C:/Users/Administrator/Documents/My Projects/MyCourts/bin/Debug/bin/DLLs/MyCourtsAdmin.DLL.
LOG: Attempting download of new URL file:///C:/Users/Administrator/Documents/My Projects/MyCourts/bin/Debug/bin/DLLs/MyCourtsAdmin/MyCourtsAdmin.DLL.
LOG: Attempting download of new URL file:///C:/Users/Administrator/Documents/My Projects/MyCourts/bin/Debug/MyCourtsAdmin.EXE.
LOG: Attempting download of new URL file:///C:/Users/Administrator/Documents/My Projects/MyCourts/bin/Debug/MyCourtsAdmin/MyCourtsAdmin.EXE.
LOG: Attempting download of new URL file:///C:/Users/Administrator/Documents/My Projects/MyCourts/bin/Debug/bin/DLLs/MyCourtsAdmin.EXE.
LOG: Attempting download of new URL file:///C:/Users/Administrator/Documents/My Projects/MyCourts/bin/Debug/bin/DLLs/MyCourtsAdmin/MyCourtsAdmin.EXE.

  StackTrace:
       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.LoadWithPartialNameInternal(AssemblyName an, Evidence securityEvidence, StackCrawlMark& stackMark)
  InnerException: 

现在 MyCourtsAdmin(在错误中引用)完全是一个单独的项目,我的项目和 MCCommon dll 都没有引用它。MyCourtsAdmin 确实引用了 MCCommon,但没有双边引用。

我已经在我的项目的整个目录结构中搜索了一个字符串“MyCourtsAdmin”,我能找到的唯一参考是在 myproject.suo 中。我当然不能编辑 myproject.suo,而且我认为我不应该这样做。

我很难过,并希望为解决此问题提供任何/所有意见。

4

0 回答 0