在 Visual Studio .NET Standard 项目中打开 MDriven EcoSpace 或 PMP 组件设计器时出错

问题描述

我创建了一个新的 .netstandard2.0 MDrivenEcoSpaceAndModelForNetStandard2 项目。创建时,我无法打开生态空间或 PMP 组件设计器。我使用的是 Microsoft Visual Studio Enterprise 2019 版本 16.8.4 和 MDriven Framework 版本 7.0.0.12868。打开 PMP 时出现以下错误。 (顺便说一句,谢谢,我很高兴看到对 .net 标准的支持。期待解决这个组件设计器的问题并让一切重新工作。将我的所有项目转换为 .net 标准/核心是一条很长的路)。非常感谢任何帮助。

自定义属性签名中不支持的类型参数。”

错误的实例 (1)

调用

在 Microsoft.MetadataReader.SignatureUtil.GetTypeId(Type type) 在 Microsoft.MetadataReader.MetadataOnlyModule.Getconstructorarguments(ConstructorInfo constructorInfo,Byte[] customAttributeBlob,Int32& index) 在 Microsoft.MetadataReader.MetadataOnlyModule.LazyAttributeParse(Token token,ConstructorInfo constructorInfo,IList1& constructorarguments,IList1& namedArguments) 在 Microsoft.MetadataReader.MetadataOnlyCustomAttributeData.InitArgumentData() 在 Microsoft.MetadataReader.MetadataOnlyCustomAttributeData.get_constructorarguments() 在 Microsoft.VisualStudio.Shell.Design.vstargetFrameworkUtil.ConstructAttribute(CustomAttributeData 数据) 在 Microsoft.VisualStudio.Shell.Design.vstargetFrameworkUtil.GetCustomAttributes(ICustomAttributesDataProvider 成员,类型过滤器,CustomAttributesCache 缓存) 在 Microsoft.VisualStudio.Shell.Design.vstargetFrameworkUtil.GetCustomAttributes(类型类型,类型过滤器,布尔继承,CustomAttributesCache 缓存) 在 Microsoft.VisualStudio.Shell.Design.vstargetFrameworkType.GetCustomAttributes(类型过滤器,布尔继承) 在 Microsoft.VisualStudio.Shell.Design.vstargetFrameworkAttributeCollection.GetAttributes(类型类型,类型过滤器) 在 Microsoft.VisualStudio.Shell.Design.vstargetFrameworkAttributeCollection.GetAttributes(MemberInfo 成员,类型过滤器) 在 Microsoft.VisualStudio.Shell.Design.vstargetFrameworkAttributeCollection.get_attributes() 在 Microsoft.VisualStudio.Design.VSDesignSurface.EnsureExtensions(IComponent 组件) 在 Microsoft.VisualStudio.Design.VSDesignSurface.CreateInstance(类型类型) 在 System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(类型 componentType,字符串名称) 在 System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(类型类型,ICollection 参数,字符串名称,布尔 addToContainer) 在 System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(类型类型,ICollection 参数,字符串名称,布尔 addToContainer) 在 System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager 管理器,CodeTypeDeclaration 声明) 在 System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.Performload(IDesignerSerializationManager manager) 在 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.Performload(IDesignerSerializationManager serializationManager) --- 从上一个抛出异常的位置开始的堆栈跟踪结束 --- 在 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.Performload(IDesignerSerializationManager serializationManager) 在 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)

打开生态空间时调用堆栈略有不同:

错误的实例 (1)

调用

在 Microsoft.MetadataReader.SignatureUtil.GetTypeId(Type type) 在 Microsoft.MetadataReader.MetadataOnlyModule.Getconstructorarguments(ConstructorInfo constructorInfo,IList1& namedArguments) 在 Microsoft.MetadataReader.MetadataOnlyCustomAttributeData.InitArgumentData() 在 Microsoft.MetadataReader.MetadataOnlyCustomAttributeData.get_constructorarguments() 在 Microsoft.VisualStudio.Shell.Design.vstargetFrameworkUtil.ConstructAttribute(CustomAttributeData 数据) 在 Microsoft.VisualStudio.Shell.Design.vstargetFrameworkUtil.GetCustomAttributes(ICustomAttributesDataProvider 成员,类型过滤器,CustomAttributesCache 缓存) 在 Microsoft.VisualStudio.Shell.Design.vstargetFrameworkUtil.GetCustomAttributes(类型类型,类型过滤器,布尔继承,CustomAttributesCache 缓存) 在 Microsoft.VisualStudio.Shell.Design.vstargetFrameworkType.GetCustomAttributes(类型过滤器,布尔继承) 在 Microsoft.VisualStudio.Shell.Design.vstargetFrameworkAttributeCollection.GetAttributes(类型类型,类型过滤器) 在 Microsoft.VisualStudio.Shell.Design.vstargetFrameworkAttributeCollection.GetAttributes(MemberInfo 成员,类型过滤器) 在 Microsoft.VisualStudio.Shell.Design.vstargetFrameworkAttributeCollection.get_attributes() 在 Microsoft.VisualStudio.Design.VSDesignSurface.EnsureExtensions(IComponent 组件) 在 Microsoft.VisualStudio.Design.VSDesignSurface.CreateInstance(类型类型) 在 System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(类型 componentType,字符串名称) 在 System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(类型类型,ICollection 参数,字符串名称,布尔 addToContainer) 在 System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(类型类型,ICollection 参数,字符串名称,布尔 addToContainer) 在 System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager 管理器,CodeTypeDeclaration 声明) 在 System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.Performload(IDesignerSerializationManager manager) 在 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.Performload(IDesignerSerializationManager serializationManager) --- 从上一个抛出异常的位置开始的堆栈跟踪结束 --- 在 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.Performload(IDesignerSerializationManager serializationManager) 在 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)

PMP Error

EcoSpace Error

解决方法

MDriven 在新项目文件格式方面存在实际问题。它在 Visual Studio 的 CodeGen 和 Save 扩展中的表现非常不同。

不过现在有所改进,我们认为从 7.0.0.12950 及更高版本开始一切正常。

当谈到为 EcoSpace 和 PMP 打开设计器时,我们仍然存在问题 - 但似乎我们并不孤单,因为在尝试打开 Winforms 设计器时也出现了同样的问题。我们需要看看 Visual Studio 未来版本如何处理这个问题。

解决方法是将文件链接到 .netFramework 项目并在那里编辑它们 - 但在 .netstandard/core 中编译它们