无法解释的MissingFieldException

时间:2012-05-10 21:24:51

标签: c# debugging exception compilation release

在下面的代码片段中,它会抛出一个MissingFieldException:Field Not Found:DepthBidLevels异常,但仅限于下面描述的某些奇怪情况。

for(int i=DomSize-1; i>=0; i--) {
    fixed( ushort *p = binary.DepthBidLevels) {
    if( i!=DomSize-1) {
        builder.Append( ",");
    }
    builder.Append( *(p + i));
}

二进制变量的类型是一个结构,它在一个单独的组件中定义:

unsafe public struct TickBinary
{
    public const int DomLevels = 5;
    public const int SymbolSize = 8;
    public const int minTickSize = 256;

    public long Symbol;
    public byte contentMask;
    public long Id;
    public long UtcTime;
    public long UtcOptionExpiration;
    public long Strike;
    public long Bid;
    public long Ask;
    public byte Side;
    public long Price;
    public int Size;
    public fixed ushort DepthAskLevels[DomLevels];
    public fixed ushort DepthBidLevels[DomLevels];
}

好的,上面的代码取决于编译的位置和方式。只要两个assmeblies(片段程序集和TickBinary程序集)都在同一台机器上编译,它们就可以正常工作。

但是,如果代码段程序集与TickBinary程序集在不同的机器上构建,然后一起运行,则会抛出MissingFieldException。

您可能想知道,为什么它们是在不同的机器上构建的?该项目将部分代码作为开源和项目的其他部分提供为预编译的二进制文件。因此,用户自己编译部分内容并简单地引用预编译的程序集。

注意:该代码段始终使用Release配置进行编译,这意味着它已启用优化。

但对我来说似乎无法解释的是它如何为DepthBidLevels字段提供缺少的字段异常。那看起来没有使用任何类型的反射,或者固定关键字是否在封面下使用反射?我对此表示怀疑,因为代码段的性能正在快速减轻。

编辑:我缩小了关键因素是程序集是由msbuild从命令行编译还是通过Visual Studio 2008编译。如果所有都是由命令行编译的,它就可以工作。如果所有都是通过Visual Studio编译的,那么它可以工作。但是使用由MSBuild构建的TickZoomEngine并使用通过Visual Studio 2008构建的TickZoomAPI1.0运行它会失败。在进行这些实验时,代码更改为零。为什么Visual Studio编译与MSBuild编译不兼容?

编辑:由于下面的想法,这里是所有程序集及其引用的转储。一切似乎都井然有序。具体来说,最后一个程序集TickZoomEngine是一个代码片段,它引用了TickZoomAPI1.0程序集中的结构类型。

Listing all assembly references...
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Microsoft.VisualStudio.HostingProcess.Utilities, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: Microsoft.VisualStudio.HostingProcess.Utilities.Sync, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: Microsoft.VisualStudio.Debugger.Runtime, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: Accessibility, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Runtime.Serialization.Formatters.Soap, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Microsoft.VisualStudio.HostingProcess.Utilities.Sync, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Microsoft.VisualStudio.Debugger.Runtime, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
vshost, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: Microsoft.VisualStudio.HostingProcess.Utilities.Sync, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: Microsoft.VisualC, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Data.SqlXml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
TickZoomGUI, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: TickZoomAPI1.0, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: TickZoomCharting, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: TickZoomPresentation, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: WindowsFormsUtil, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
TickZoomPresentation, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: TickZoomAPI1.0, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
TickZoomAPI1.0, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
WindowsFormsUtil, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: TickZoomPresentation, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: TickZoomAPI1.0, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
PluginLoader, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: TickZoomAPI1.0, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: ICSharpCode.SharpZipLib, Version=0.85.5.452, Culture=neutral, PublicKeyToken=1b03e6acf1164f73
TickZoomLogging, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: TickZoomAPI1.0, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821
    Reference: System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
TickZoomCharting, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: TickZoomAPI1.0, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: ZedGraph, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: WindowsFormsUtil, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.DirectoryServices.Protocols, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Web.RegularExpressions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Accessibility, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
TickZoomPluginCommon, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: TickZoomAPI1.0, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Runtime.Serialization.Formatters.Soap, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
TickZoomPluginExamples, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: TickZoomPluginCommon, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: TickZoomAPI1.0, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Reference: System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
ProviderCommon, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: TickZoomAPI1.0, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
ProviderUtilTests, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: TickZoomAPI1.0, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: nunit.framework, Version=2.5.1.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
    Reference: ProviderUtil, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
TickZoomLoaderTests, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: TickZoomAPI1.0, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: nunit.framework, Version=2.5.1.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
    Reference: PluginLoader, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
ExamplesTest, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: TickZoomPluginCommon, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: nunit.core, Version=2.5.1.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
    Reference: nunit.core.interfaces, Version=2.5.1.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
    Reference: TickZoomAPI1.0, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: TickZoomCharting, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: TickZoomPresentation, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: WindowsFormsUtil, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: TickZoomPluginExamples, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: TickZoomGUI, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: TickZoomStarters, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: nunit.framework, Version=2.5.1.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
    Reference: TickZoomTickUtil, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: ZedGraph, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
nunit.core, Version=2.5.1.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: nunit.core.interfaces, Version=2.5.1.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
nunit.core.interfaces, Version=2.5.1.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
LimeProviderUnitTests, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
TickZoomTesting, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: TickZoomPluginCommon, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: TickZoomPluginExamples, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: TickZoomAPI1.0, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: TickZoomCharting, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: TickZoomStarters, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: nunit.framework, Version=2.5.1.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
    Reference: TickZoomTickUtil, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: tzdata, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
TickZoomEngine, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: TickZoomAPI1.0, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Reference: TickZoomTickUtil, Version=1.4.8.8462, Culture=neutral, PublicKeyToken=null
    Reference: System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

4 个答案:

答案 0 :(得分:3)

只需将失败的方法移动到另一个dll中即可解决问题。所以现在它引用的字段在同一个DLL中。

这只是意味着加载器逻辑在运行时绑定到固定结构域时是不稳定的。

答案 1 :(得分:2)

比较引用的程序集(依赖项)的两个二进制文件清单(您编译的程序集)。

System.Reflection.Assembly::GetReferencedAssemblies()

并进行比较..也许它们编译的框架之间存在版本差异。

答案 2 :(得分:2)

不知道是否有人会遇到这个,但我也有这个问题。转过来我的项目引用了两个.dll,称之为A.dllB.dll

A.dll也引用了B.dll。自从我上次构建项目以将某些字段更改为属性以来,B.dll已更新。一旦我再次构建了我的项目,我就遇到了这里描述的问题。

原来,由于A.dll更新后B.dll还没有再次构建,A.dll期待B.dll字段,但新构建的B.dll 1}}我的项目使用了属性。

答案 3 :(得分:0)

努力隐藏属性背后的字段。一旦我将一个易失性区域隐藏在一个属性后面并使其变得非易失性,一个非常类似的问题就消失了。