c# – 自dll更新后VS无法打开控件

c# – 自dll更新后VS无法打开控件,第1张

概述我看过很多地方,包括谷歌和SO,但我没有找到任何相关的答案. 我最近在我的应用程序中做了一些更改,包括更新ZedGraph dll(从5.1.4.26270到5.1.6.405),因此,VS不会打开我的控件抛出此错误: Could not load file or assembly ‘ZedGraph, Version=5.1.4.26270, Culture=neutral, PublicKey 我看过很多地方,包括谷歌和SO,但我没有找到任何相关的答案.

我最近在我的应用程序中做了一些更改,包括更新ZedGraph dll(从5.1.4.26270到5.1.6.405),因此,VS不会打开我的控件抛出此错误:

Could not load file or assembly ‘ZedGraph,Version=5.1.4.26270,Culture=neutral,PublicKeyToken=…’ or one of its dependencIEs. The system cannot find the file specifIEd.

哪个指向旧版本.我到处看,我没有找到任何这个旧版本的痕迹.

它也抛出这个错误:

The variable ‘lineGraphControl1’ is either undeclared or was never assigned.

而我调用构造函数:

this.lineGraphControl1 = new Sakura.UI.Graphing.lineGraphControl();

我试着:

>重新启动
>清洁和RebluID
>以管理员模式启动VS.
>删除参考并重新添加

没有成功.

如何擦除旧ZedGraph lib的跟踪以及如何修复此错误?

编辑

这是旧版本和新版本(旧版本)之间的变化

<Reference Include="ZedGraph,PublicKeyToken=02a83cbd123fcd60,processorArchitecture=MSIL">  <SpecificVersion>False</SpecificVersion>  <HintPath>..\..\lib\ZedGraph.dll</HintPath></Reference>
<Reference Include="ZedGraph,Version=5.1.6.405,processorArchitecture=MSIL">  <SpecificVersion>False</SpecificVersion>  <HintPath>..\..\lib\ZedGraph.dll</HintPath></Reference>

编辑2

清除VS的缓存并重新启动计算机后,错误消息已更改:

at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.Ensuredocument(IDesignerSerializationManager manager)at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.Performload(IDesignerSerializationManager manager)at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.Performload(IDesignerSerializationManager serializationManager)at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)

我搞不清楚了.

编辑3

我在整个磁盘中搜索字符串5.1.4.26270,找到的唯一地方不在项目中.

csproj片段:

<Reference Include="ZedGraph,processorArchitecture=MSIL">  <SpecificVersion>False</SpecificVersion>  <HintPath>..\..\lib\ZedGraph.dll</HintPath></Reference>

编辑4:

(Hans Passant之后)

这是lineGraphControl声明:

public class lineGraphControl : GraphControl<Sakura.Graphing.lineGraph>

lineGraph(使用ZedGraph对象)

public class lineGraph : Graph,ISerializable

图表:

[Xmlinclude(typeof(StackedGraph))][Xmlinclude(typeof(lineGraph))][Xmlinclude(typeof(BubbleGraph))][Xmlinclude(typeof(BatchGraph))][Serializable]public abstract class Graph : ISerializable

不幸的是,ZedGraph lib与软件有很深的联系,可以将它改为另一个.

我不会回滚这些更改,因为我以一种使我的软件绘图速度提高250%的方式调整库.

这是在VS中打开lineGraphControl的试验性的callstack:

at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.Ensuredocument(IDesignerSerializationManager manager)at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.Performload(IDesignerSerializationManager manager)at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.Performload(IDesignerSerializationManager serializationManager)at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)

Here’s the activity log

我尝试创建一个新的lineGraphControl时出现错误消息:

ProcMon提取物:

解决方法 问题

错误是找不到的文件,like the one I helped out with the other day:

Could not load file or assembly .. The system cannot find the file specifIEd.

故障排除

打开ProcessMonitor并在VS不允许您打开控件并抛出错误时运行它.在失败时停止跟踪并调查ProcMon的(filemon)日志以查看IDE在哪里查找它找不到的DLL.

将DLL放在预期找到的位置(这有望排除VS库引用失败).

进程监视器帮助在Resharper插件目录中发现了ZedGraph.dll的奇怪引用.我按照这个步骤:

>禁用Resharper>重启VS>清洁&重建>再次启用Resharper>微笑

总结

以上是内存溢出为你收集整理的c# – 自dll更新后VS无法打开控件全部内容,希望文章能够帮你解决c# – 自dll更新后VS无法打开控件所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/1252106.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-07
下一篇2022-06-07

发表评论

登录后才能评论

评论列表(0条)

    保存