I've look in many places including google and SO but I didn't find any relevant answer.
I've made a few changes in my app recently, including updating ZedGraph dll (from 5.1.4.26270 to 5.1.6.405) and since, VS won't open my controls throwing this error:
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.
Which point to the old version. I've look everywhere, I don't find any trace of this old version.
It also throw this error:
The variable 'lineGraphControl1' is either undeclared or was never assigned.
Whereas I call the constructor:
this.lineGraphControl1 = new Sakura.UI.Graphing.LineGraphControl();
I've try to:
- Reboot
- Clean and Rebluid
- Start VS in admin mode
- Remove the reference and re-add it
Without success.
How can I erase trace of the old ZedGraph lib and how can I fix this error?
Edit
Here's the changes between the old version and the new (old first)
<Reference Include="ZedGraph, Version=5.1.4.26270, Culture=neutral, PublicKeyToken=02a83cbd123fcd60, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\ZedGraph.dll</HintPath>
</Reference>
<Reference Include="ZedGraph, Version=5.1.6.405, Culture=neutral, PublicKeyToken=02a83cbd123fcd60, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\ZedGraph.dll</HintPath>
</Reference>
Edit 2
After clearing the cache of VS and rebooting the computer, the error message changed:
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)
I am lost.
Edit 3
I've search through the whole disk for the string 5.1.4.26270
and the only place found are not in the project.
csproj snippet :
<Reference Include="ZedGraph, Version=5.1.6.405, Culture=neutral, PublicKeyToken=02a83cbd123fcd60, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\ZedGraph.dll</HintPath>
</Reference>
Edit 4:
(After Hans Passant anwser)
Here's the LineGraphControl declaration:
public class LineGraphControl : GraphControl<Sakura.Graphing.LineGraph>
The LineGraph (which use ZedGraph objects)
public class LineGraph : Graph, ISerializable
The Graph:
[XmlInclude(typeof(StackedGraph))]
[XmlInclude(typeof(LineGraph))]
[XmlInclude(typeof(BubbleGraph))]
[XmlInclude(typeof(BatchGraph))]
[Serializable]
public abstract class Graph : ISerializable
Unfortunately the ZedGraph lib is to deeply linked to the software to change it to another one.
I won't rollback the changes because I've adapt the library in a way that make my software graphing 250% faster.
Here's the callstack of the tentative to open the LineGraphControl in 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 System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)
Error message when I try to create a new LineGraphControl
:
The ProcMon extract: