VS2010尝试加载未引用的程序集

时间:2012-08-15 23:22:31

标签: visual-studio-2010

在我解释实际问题之前,在一段未知的时间内,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,我不相信我应该这样做。

我很难过,并且非常感谢解决这个问题的任何/所有意见。

0 个答案:

没有答案