在Vista中编译的VB.NET应用程序在XP上不起作用 [英] VB.NET app compiled in Vista does not work on XP

查看:79
本文介绍了在Vista中编译的VB.NET应用程序在XP上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我当前的应用程序出了问题。我目前在Visual Studio Express 2008上使用

Windows Vista。如果我在Vista上编译

应用程序,它在Vista上运行正常,但它不能正常工作

XP。如果我在XP上编译它(使用相同的源代码[从

vista复制]),它运行没有任何问题。


事情是:我只有一台虚拟机可以在XP上测试我的软件,

但是我无法在它上面开发。

当我尝试申报公众时出现错误OleDb对象。这里

来源:


公共DatabaseConnection作为新的OleDb.OleDbConnection


只有当我发生此错误时才会发生尝试填充这个OleDb对象的

的ConnectionString。

错误信息本身并没有用,所以我不会发布它

现在。

我的问题是:问题出在哪里,是否有人与Vista和XP应用程序有类似的问题?

谢谢你的帮助。


-

pmw

解决方案

9月22日,4:00 * pm,pmw< we ... @ see64.chwrote:





我当前的应用程序出了问题。我目前在Visual Studio Express 2008上使用

Windows Vista。如果我在Vista上编译

应用程序,它在Vista上运行正常,但它不能正常工作

XP。如果我在XP上编译它(使用相同的源代码[从

vista复制]),它运行没有任何问题。


事情是:我只有一台虚拟机可以在XP上测试我的软件,

但我无法开发它。


当我尝试时出现错误声明一个公共的OleDb对象。这里

来源:


公共DatabaseConnection作为新的OleDb.OleDbConnection


只有当我发生此错误时才会发生尝试填充这个OleDb对象的

的ConnectionString。


错误信息本身并没有用,所以我不会发布它

现在。


我的问题是:问题出在哪里,是否有人与Vista和XP应用程序有类似问题?
类似问题?


感谢您的帮助。


-

pmw



错误是什么?


9月22日16:04,kimiraikkonen< kimiraikkone ... @ gmail.comwrote :


9月22日下午4:00 * pm,pmw< we ... @ see64.chwrote:


Hi


我当前的应用程序出了问题。我目前在Visual Studio Express 2008上使用

Windows Vista。如果我在Vista上编译

应用程序,它在Vista上运行正常,但它不能正常工作

XP。如果我在XP上编译它(使用相同的源代码[从

vista复制]),它运行没有任何问题。


事情是:我只有一台虚拟机在XP上测试我的软件,

但是我可以''在它上面发展。


当我尝试声明一个公共OleDb对象时,错误显示出来。这里

来源:


Public DatabaseConnection As New OleDb.OleDbConnection


只有当我尝试填充这个OleDb对象的

的ConnectionString时才会发生此错误。


错误信息本身并没有用,所以我现在不会发布它/ b $ b。


我的问题是:问题在哪里,是否有人与Vista和XP应用程序有类似问题?
类似问题?


感谢您的帮助。


-

pmw



什么''错误? - Zitierten Text ausblenden -


- Zitierten Text anzeigen -



错误编号5 - 类型初始值设定项

Project.ModuleGlobalVariables抛出一个异常


和ex.InnerException.Message说:

抛出异常调用的目标


9月22日,5:16 * pm,PmW< we ... @ see64.chwrote:


9月22日16:04,kimiraikkonen< kimiraikkone ... @ gmail.comwrote:



9月22日,4:00 * pm,pmw< we ... @ see64.chwrote:


Hi


我的当前申请有问题。我目前在Visual Studio Express 2008上使用

Windows Vista。如果我在Vista上编译

应用程序,它在Vista上运行正常,但它不能正常工作

XP。如果我在XP上编译它(使用相同的源代码[从

vista复制]),它运行没有任何问题。


事情是:我只有一台虚拟机在XP上测试我的软件,

但我不能发展它。


当我尝试声明一个公共OleDb对象时,错误显示出来。这里

来源:


Public DatabaseConnection As New OleDb。 OleDbConnection


只有在我尝试填充

这个OleDb对象。


错误信息本身并没有用,所以我不会发布它br />
现在。


我的问题是:问题出在哪里,是否有人有

与Vista和XP应用程序类似的问题?


感谢您的帮助。


-

pmw


错误是什么? - Zitierten Text ausblenden -


- Zitierten Text anzeigen -



错误编号5 -

的类型初始化程序Project.ModuleGlobalVariables抛出异常


和ex.InnerException.Message说:抛出异常

调用目标 - 隐藏引用文本 -


- 显示引用的文字 -



对不起,没有看到完整的代码(如果它不是太长),我就不能做了

除了猜测以下原因之外:


1)确保使用正确的连接字符串语法。请访问
http://www.connectionstrings.com 了解更多信息。


2)尝试将代码置于Try-Catch块中并捕获实际的

错误,如果它提供了额外的线索。

赞:


尝试

''...所有代码包括连接字符串

''以及与OleDb相关的东西对象

Catch ex As Exception

Msgbox(ex.Message.ToString)

结束尝试


3)尝试在Using-End中使用

初始化您的一次性OleDb类,以确保没有待处理的打开连接。


全部来自我。


希望这会有所帮助,


OnurGüzel


Hi

I''ve got a problem with my current application. I currently use
Windows Vista with Visual Studio Express 2008. If I compile the
application on Vista, it works fine on Vista, but it doesn''t work on
XP. If I compile it on XP (with the same source code [copied from
vista]), it runs without any problems.

The thing is: I only have a virtual machine to test my software on XP,
but I can''t develop on it.
The error shows up, when I try to declare a public OleDb object. Here
the source:

Public DatabaseConnection As New OleDb.OleDbConnection

This error only happens, when I try to fill up the ConnectionString of
this OleDb Object.
The error message itself is not really helpful, so I won''t post it
right now.
My Question is: Where is the problem, is there someone which had
similar problem with Vista and XP apps?
Thank you for your help.

--
pmw

解决方案

On Sep 22, 4:00*pm, pmw <we...@see64.chwrote:

Hi

I''ve got a problem with my current application. I currently use
Windows Vista with Visual Studio Express 2008. If I compile the
application on Vista, it works fine on Vista, but it doesn''t work on
XP. If I compile it on XP (with the same source code [copied from
vista]), it runs without any problems.

The thing is: I only have a virtual machine to test my software on XP,
but I can''t develop on it.

The error shows up, when I try to declare a public OleDb object. Here
the source:

Public DatabaseConnection As New OleDb.OleDbConnection

This error only happens, when I try to fill up the ConnectionString of
this OleDb Object.

The error message itself is not really helpful, so I won''t post it
right now.

My Question is: Where is the problem, is there someone which had
similar problem with Vista and XP apps?

Thank you for your help.

--
pmw

What''s the error?


On 22 Sep., 16:04, kimiraikkonen <kimiraikkone...@gmail.comwrote:

On Sep 22, 4:00*pm, pmw <we...@see64.chwrote:


Hi

I''ve got a problem with my current application. I currently use
Windows Vista with Visual Studio Express 2008. If I compile the
application on Vista, it works fine on Vista, but it doesn''t work on
XP. If I compile it on XP (with the same source code [copied from
vista]), it runs without any problems.

The thing is: I only have a virtual machine to test my software on XP,
but I can''t develop on it.

The error shows up, when I try to declare a public OleDb object. Here
the source:

Public DatabaseConnection As New OleDb.OleDbConnection

This error only happens, when I try to fill up the ConnectionString of
this OleDb Object.

The error message itself is not really helpful, so I won''t post it
right now.

My Question is: Where is the problem, is there someone which had
similar problem with Vista and XP apps?

Thank you for your help.

--
pmw


What''s the error?- Zitierten Text ausblenden -

- Zitierten Text anzeigen -

Error Number 5 - The type initializer for
Project.ModuleGlobalVariables threw an exception

and the ex.InnerException.Message says: "Exception has been thrown by
the target of an invocation"


On Sep 22, 5:16*pm, PmW <we...@see64.chwrote:

On 22 Sep., 16:04, kimiraikkonen <kimiraikkone...@gmail.comwrote:


On Sep 22, 4:00*pm, pmw <we...@see64.chwrote:

Hi

I''ve got a problem with my current application. I currently use
Windows Vista with Visual Studio Express 2008. If I compile the
application on Vista, it works fine on Vista, but it doesn''t work on
XP. If I compile it on XP (with the same source code [copied from
vista]), it runs without any problems.

The thing is: I only have a virtual machine to test my software on XP,
but I can''t develop on it.

The error shows up, when I try to declare a public OleDb object. Here
the source:

Public DatabaseConnection As New OleDb.OleDbConnection

This error only happens, when I try to fill up the ConnectionString of
this OleDb Object.

The error message itself is not really helpful, so I won''t post it
right now.

My Question is: Where is the problem, is there someone which had
similar problem with Vista and XP apps?

Thank you for your help.

--
pmw

What''s the error?- Zitierten Text ausblenden -

- Zitierten Text anzeigen -


Error Number 5 - The type initializer for
Project.ModuleGlobalVariables threw an exception

and the ex.InnerException.Message says: "Exception has been thrown by
the target of an invocation"- Hide quoted text -

- Show quoted text -

Sorry, without seeing full code (if it''s not too long), i can''t make
out the reason beyond guessing the following:

1)Make sure you are using proper connection string syntax. Look at
http://www.connectionstrings.com for more info.

2)Try to put your code inside a Try-Catch block and catch the actual
error if it provides additional clue.
Like:

Try
''...All the code including connection string
'' and stuff related to OleDb object
Catch ex As Exception
Msgbox(ex.Message.ToString)
End Try

3)Try to initialize your disposable OleDb class within Using-End Using
to ensure there''s no pending open connections.

All from me.

Hope this helps,

Onur Güzel


这篇关于在Vista中编译的VB.NET应用程序在XP上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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