Designer view error: Could not load file or assembly - wrong assembly version

Designer view error: Could not load file or assembly - wrong assembly version

我无法在任何地方找到这种特殊类型的错误。

Designer 视图失败并出现以下错误。失败的程序集 ZedGraph 实际上是版本 4.3.8.12(新更改),而不是 4.3.8.11。我已手动清理、重建和清空 objbin 文件夹。在 "4.3.8.11" 上进行文本搜索。我无法在我的解决方案中的任何地方找到它,包括项目文件或解决方案文件。调试和部署工作正常。

我有自己的 UserControl,其中嵌入了 ZedGraph 组件。 它还使用 DevExpress 个组件。

提前致谢, 马库斯

Could not load file or assembly 'ZedGraph, Version=4.3.8.11,
Culture=neutral, PublicKeyToken=null' or one of its dependencies.
The system cannot find the file specified. 

at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName,
String codeBase, Evidence assemblySecurity, RuntimeAssembly
locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder,
Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean
suppressSecurityChecks) at
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String
codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint,
StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean
throwOnFileNotFound, Boolean forIntrospection, Boolean
suppressSecurityChecks) at
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName
assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly,
StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean
throwOnFileNotFound, Boolean forIntrospection, Boolean
suppressSecurityChecks) at
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr
pPrivHostBinder, Boolean forIntrospection) at
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection) at System.Reflection.Assembly.Load(String
assemblyString) at
System.UnitySerializationHolder.GetRealObject(StreamingContext
context) at
    System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHolder
holder) at System.Runtime.Serialization.ObjectManager.DoFixups() at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler
handler, __BinaryParser serParser, Boolean fCheck, Boolean
isCrossAppDomain, IMethodCallMessage methodCallMessage) at
    System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream
serializationStream, HeaderHandler handler, Boolean fCheck, Boolean
isCrossAppDomain, IMethodCallMessage methodCallMessage) at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream
serializationStream) at
System.Resources.ResXDataNode.GenerateObjectFromDataNodeInfo(DataNodeInfo
dataNodeInfo, ITypeResolutionService typeResolver) at
System.Resources.ResXDataNode.GetValue(ITypeResolutionService
typeResolver) at
System.Resources.ResXResourceReader.ParseDataNode(XmlTextReader
reader, Boolean isMetaData) at
System.Resources.ResXResourceReader.ParseXml(XmlTextReader reader)

解决了。

在此处找到解决方案:https://davidhogue.com/blog/2006/10/how-to-keep-the-visual-studio-designer-out-of-your-controls-properties/

此处讨论: