目录

[Map 3D开发实战系列] Map Resource Explorer 背景介绍--Kick off

[Map 3D开发实战系列] Map Resource Explorer 之二-- 运行和调试

[Map 3D开发实战系列] Map Resource Explorer 之三-- 添加AutoCAD风格的Palette界面

如果你已经随着我们前面的文章开始创建基于WPF技术的Map 3D自定义界面的话,你可能会遇到一个比较棘手的问题,就是在Visual Studio 2008中的WPF编辑器中,可视化界面总是显示错误,从而不能想Winform界面设计一样拖控件进去。更麻烦的是两xaml编辑器的智能提示都没有了,这对我这样的WPF菜鸟来说真是要命啊!

每次在Visual Studio 2008中打开xaml文件,总是显示下面的错误信息:

An Unhandled Exception has occured.

A BadImageFormatException has been thrown while parsing the signature. This is likely due to lack of a generic context. Ensure genericTypeArguments and genericMethodArguments are provided and contain enough context.


   at System.Reflection.Module.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
   at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, Module decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, RuntimeMethodHandle& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
   at System.Reflection.CustomAttribute.GetCustomAttributes(Module decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes)
   at System.Reflection.CustomAttribute.GetCustomAttributes(Assembly assembly, RuntimeType caType)
   at System.Reflection.Assembly.GetCustomAttributes(Type attributeType, Boolean inherit)
   at MS.Internal.Xaml.ReflectionProjectNode.BuildSubsumption()
   at MS.Internal.Xaml.ReflectionProjectNode.SubsumingNamespace(Identifier identifier)
   at MS.Internal.Xaml.XmlElement.BuildScope(PrefixScope parentScope, IParseContext context)
   at MS.Internal.Xaml.XmlElement.FindElementType(PrefixScope parentScope, IParseContext context)
   at MS.Internal.DocumentTrees.Markup.XamlSourceDocument.get_RootType()
   at Microsoft.Windows.Design.Documents.Trees.MarkupDocumentTreeManager.get_RootType()
   at Microsoft.Windows.Design.Documents.MarkupDocumentManager.CalculateLoadErrorState()
   at Microsoft.Windows.Design.Documents.MarkupDocumentManager.get_LoadState()
   at MS.Internal.Host.PersistenceSubsystem.Load()
   at MS.Internal.Host.Designer.Load()
   at MS.Internal.Designer.VSDesigner.Load()
   at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load()
   at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView view)
   at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
   at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
   at MS.Internal.Host.Isolation.IsolatedDesigner.Load()
   at MS.Internal.Designer.DesignerPane.LoadDesignerView()

Could not load file or assembly 'acmgd, Version=18.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.


   at System.ModuleHandle.ResolveType(Int32 typeToken, RuntimeTypeHandle* typeInstArgs, Int32 typeInstCount, RuntimeTypeHandle* methodInstArgs, Int32 methodInstCount)
   at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
   at System.Reflection.Module.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)

这其实是Map 3D 2011的一个bug。前面的文章中介绍了,我们要开发Map 3D 应用程序,需要添加下列的Map 3D相关引用:

Map 3D相关程序集:

Autodesk.Map.Platform.dll

Autodesk.Map.Platform.Core.dll

Autodesk.Map.Platform.Utils.dll;

Autodesk.Gis.Map.Shared.dll;

OSGeo.MapGuide.Foundation.dll

OSGeo.MaoGuide.PlatformBase.dll

但引用的上面的Map 3D相关程序集,就会造成Visual Studio 的WPF编辑器工作不正常。当然你可以使用Blend,XamlPad等其他工具来编辑Xaml界面,但对于我们简单的界面设计来说,Blend有点大材小用,而且学习这个软件也得花不少时间。

解决的办法就是在设计界面是,暂时把上面的Map 3D相关程序集的引用移除,这样WPF界面编辑器就可以正常工作了。编辑好了界面,需要编译运行时,再重新把这些程序集的引用加进来就行了。Visual Studio引用对话框的Recent选项卡可以快速的帮我找到最近用过的程序集,还是很方便的。

好了,先到这里,现在你可以开始设计你的基于Map 3D应用程序WPF界面了。

Cheers,

峻祁连

转载于:https://www.cnblogs.com/junqilian/archive/2011/02/01/1948618.html

[Map 3D开发实战系列] Map Resource Explorer 之四-- Map3D开发中的WPF相关推荐

  1. 【直播回顾】云栖社区特邀专家徐雷Java Spring Boot开发实战系列课程(第19讲):Java Spring Cloud微服务架构模式与开发实战...

    主讲人:徐雷(云栖社区特邀Java专家) 徐雷,花名:徐雷frank:资深架构师,MongoDB中文社区联席主席,吉林大学计算机学士,上海交通大学硕士.从事了 10年+开发工作,专注于分布式架构,Ja ...

  2. springboot 事务统一配置_Spring Boot实现分布式微服务开发实战系列(五)

    最近已经推出了好几篇SpringBoot+Dubbo+Redis+Kafka实现电商的文章,今天再次回到分布式微服务项目中来,在开始写今天的系列五文章之前,我先回顾下前面的内容. 系列(一):主要说了 ...

  3. springboot 插入返回id_Spring Boot实现分布式微服务开发实战系列(七)

    今天已经进入第七讲了,整个微服务架构的搭建工作也基本完成.那到目前为止究竟使用了那些技术及实现了什么功能呢?我们先回顾一下. 使用的技术:SpringBoot.Dubbo.Zookeeper.Redi ...

  4. WCF开发实战系列四:使用Windows服务发布WCF服务

    WCF开发实战系列四:使用Windows服务发布WCF服务 (原创:灰灰虫的家http://hi.baidu.com/grayworm) 上一篇文章中我们通过编写的控制台程序或WinForm程序来为本 ...

  5. 鸿蒙开发实战系列之三:网络请求(原生+ Retrofit)

    鸿蒙开发实战系列之一:鸿蒙开发实战系列之一:圆角 鸿蒙开发实战系列之二:鸿蒙开发实战系列之二:事件总线EventBus/RxBus 前言 过了一个漫长的中秋+国庆假期,大家伙的鸿蒙内功修炼的怎么样了? ...

  6. 云栖社区特邀专家徐雷——Java Spring Boot开发实战系列课程【往期直播回顾】...

    徐雷,花名:徐雷frank:资深架构师,MongoDB中文社区联席主席,吉林大学计算机学士,上海交通大学硕士.从事了 10年+开发工作,专注于分布式架构,Java Spring Boot.Spring ...

  7. 鸿蒙开发实战系列之五:鸿蒙系统原生数据库

    鸿蒙开发实战系列之一:鸿蒙开发实战系列之一:圆角 鸿蒙开发实战系列之二:鸿蒙开发实战系列之二:事件总线EventBus/RxBus 鸿蒙开发实战系列之三:鸿蒙开发实战系列之三:网络请求(原生+ Ret ...

  8. AI应用开发实战系列之二:从零开始搭建macOS开发环境

    AI应用开发实战 - 从零开始搭建macOS开发环境 本视频配套的视频教程请访问:https://www.bilibili.com/video/av24368929/ 零.前提条件 一台能联网的电脑, ...

  9. 物联网全栈开发实战系列文章汇总(共865篇,持续更新-2023.05.02)

    物联网全栈开发实战(共865篇) 文章目录 物联网全栈开发实战(共865篇) 1.Arduino单片机系列 1.1 Arduino开发实例(包含各类传感器驱动.通信实例.DIY实例,共114篇) 1. ...

最新文章

  1. 3.Android 优化布局(解决TextView布局)
  2. C++11之thread线程
  3. 【工作感悟】java编程规范pdf下载
  4. Android 最新左右可见上下页的banner实现demo
  5. 2016全国计算机二级题,2016全国计算机二级考生试题及答案
  6. Android学习视频Mars-Android开发视频教程(全集)
  7. PIFA-平面倒F天线[搬运]
  8. 备战数学建模41-蒙特卡罗模拟(攻坚战5)
  9. 为什么我们要用密码生成器?
  10. 永川机器人博览会门票_2018世界机器人博览会门票价格
  11. 图片怎样编辑文字?分享三个图片编辑修改文字的方法
  12. iphone12 fiddler抓包,代理证书无法下载解决
  13. 怎样设置和使用speedceo?简洁浏览器的使用分享
  14. html的css样式大全,css样式有哪些?
  15. unity地形模块学习
  16. 注册Outlook如何跳过手机验证
  17. bga封装扇出过孔,用Allegro软件如何实现BGA封装的扇出?
  18. 【纪念第一次AK(泪目)】第一届ACC(AcWing Cup)全国高校联赛(初赛)(Java版)
  19. HDU 1114:Piggy-Bank ← 完全背包问题
  20. SuperMap制图之瓦片技术

热门文章

  1. MySQL-[Err] 1055 - Expression #1
  2. QML 发光呼吸动画字体
  3. AndroidOrientation Sensor(方向传感器),新的替代方法详解(安卓官方提供)
  4. java element 获取属性_java 获取类,属性变量,方法,方法参数上注解的值等
  5. python核心教程百度云_Python核心技术与实战 共44讲 中文pdf高清版
  6. JQuery:全选按钮的实现
  7. signal.h 中的宏定义 SIG_DFL 及 SIG_IGN
  8. 启明云端分享|ESP32-C3有望三月中旬量产出货,ESP32-C3-MINI-1模块技术规格书分享
  9. java静态类和非静态类_关于java:静态和非静态内部类的区别?
  10. MTK平台APP层 通过INvram获取SN号