5

在以下代码片段中,它会引发 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];
}

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

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

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

注意:片段总是使用发布配置编译,这意味着它启用了优化。

但对我来说似乎莫名其妙的是它如何为 DepthBidLevels 字段提供缺失字段异常。这似乎没有使用任何类型的反射,或者 fixed 关键字是否在幕后使用反射?我对此表示怀疑,因为代码片段的性能正在快速下降。

编辑:我缩小了关键因素是程序集是由 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

3 回答 3

3

通过简单地将失败的方法移动到另一个dll中来解决它。所以现在它引用的字段在同一个 DLL 中。

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

于 2012-05-11T15:46:30.070 回答
2

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

System.Reflection.Assembly::GetReferencedAssemblies()

并比较..它们编译的框架之间可能存在版本差异。

于 2012-05-10T22:44:19.510 回答
2

我也有这个问题。转身我的项目是引用两个 .dll,调用它们A.dllB.dll.

A.dll也参考了B.dllB.dll自从我上次构建我的项目以将一些字段更改为属性以来已经更新。再次构建项目后,我遇到了此处描述的问题。

原来,自从更新后就A.dll没有重建,期待with 字段,但是我的项目正在使用的新构建的属性。B.dllA.dllB.dllB.dll

于 2018-06-18T21:42:22.907 回答