GMap.NET 1.7异常抛出 [英] GMap.NET 1.7 Exception Throw

查看:220
本文介绍了GMap.NET 1.7异常抛出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我在Visual Studio 2008中将GMap.NET(1.7版)用于C#. 效果很好,但是,我无法再运行winform应用.

Currently, I'm using GMap.NET (1.7 version) for C# with Visual Studio 2008. It works fine, however, I'm not able to run my winform app any more.

为我的表单触发InitializeComponent()时出现此错误. GMap.NET.WindowsForms.GMapControl的类型初始值设定项引发异常.

I'm getting this error when firing InitializeComponent() for my form. The type initializer for GMap.NET.WindowsForms.GMapControl throws an exception.

如果我恢复到1.6版本,则可以正常工作.

If I revert back to 1.6 version, it works fine.

有人知道这种问题吗?

推荐答案

我最近也遇到了同样的问题.但是我的项目必须是x64解决方案.以下内容对我有用,也许对您也有帮助.

I struggled with the same problems recently. But my project had to be a x64-solution. The following worked for me, maybe it will help you, too.

如果下载GMap.Net-Sources,则可以构建库的"AnyCode"版本.通常,(如果您仅使用WindowsForms-Component)不需要重新编译所有内容,对我而言,重新编译GMap.Net.Core和GMap.Net.WindowsForms就足够了.

If you download the GMap.Net-Sources, you can build an "AnyCode"-Version of the Library. You normally (if you only use the WindowsForms-Component) don't need to recompile everything, for me it was enough to recompile GMap.Net.Core and GMap.Net.WindowsForms.

然后,您可以在项目中引用新编译的dll. Winforms-Designer将使用x86-variant,当您决定仅针对x64进行构建时,您的程序将使用x64-version.

Then you can reference the newly compiled dlls in your project. The Winforms-Designer will be using the x86-variant, your program, when you decide to build for x64 only, will use the x64-version.

您必须手动将SQLite.Interop-dll复制到%SOLUTION%/bin/Release | Debug/x64和x86-x64和x86是Release/Debug文件夹的子文件夹.

You have to manually copy the SQLite.Interop-dlls into %SOLUTION%/bin/Release|Debug/x64 and x86 - x64 and x86 are subfolders of the Release/Debug folder.

如果您的解决方案中有一个安装项目,则必须将这些dll手动放入应用程序文件夹"内的相同文件夹中. System.Data.SQLite和手动添加的GMap-Dlls的依赖关系将由Setup-Project自动设置(也许您需要执行刷新依赖关系),因为它们是GMap-Components的依赖关系.

If you have a setup-project in your solution, these dlls have to be manually put into the same folders inside the "Application Folder". The dependency for System.Data.SQLite and the manually added GMap-Dlls will be automatically set by the Setup-Project (maybe you have to do a refresh dependencies), as they are dependencies of the GMap-Components.

这篇关于GMap.NET 1.7异常抛出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆