Connecting Tech Pros Worldwide Forums | Help | Site Map

VB.NET app compiled in Vista does not work on XP

pmw
Guest
 
Posts: n/a
#1: Sep 22 '08
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

kimiraikkonen
Guest
 
Posts: n/a
#2: Sep 22 '08

re: VB.NET app compiled in Vista does not work on XP


On Sep 22, 4:00*pm, pmw <we...@see64.chwrote:
Quote:
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?
PmW
Guest
 
Posts: n/a
#3: Sep 22 '08

re: VB.NET app compiled in Vista does not work on XP


On 22 Sep., 16:04, kimiraikkonen <kimiraikkone...@gmail.comwrote:
Quote:
On Sep 22, 4:00*pm, pmw <we...@see64.chwrote:
>
>
>
>
>
Quote:
Hi
>
Quote:
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.
>
Quote:
The thing is: I only have a virtual machine to test my software on XP,
but I can't develop on it.
>
Quote:
The error shows up, when I try to declare a public OleDb object. Here
the source:
>
Quote:
Public DatabaseConnection As New OleDb.OleDbConnection
>
Quote:
This error only happens, when I try to fill up the ConnectionString of
this OleDb Object.
>
Quote:
The error message itself is not really helpful, so I won't post it
right now.
>
Quote:
My Question is: Where is the problem, is there someone which had
similar problem with Vista and XP apps?
>
Quote:
Thank you for your help.
>
Quote:
--
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"
kimiraikkonen
Guest
 
Posts: n/a
#4: Sep 22 '08

re: VB.NET app compiled in Vista does not work on XP


On Sep 22, 5:16*pm, PmW <we...@see64.chwrote:
Quote:
On 22 Sep., 16:04, kimiraikkonen <kimiraikkone...@gmail.comwrote:
>
>
>
>
>
Quote:
On Sep 22, 4:00*pm, pmw <we...@see64.chwrote:
>
Quote:
Quote:
Hi
>
Quote:
Quote:
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.
>
Quote:
Quote:
The thing is: I only have a virtual machine to test my software on XP,
but I can't develop on it.
>
Quote:
Quote:
The error shows up, when I try to declare a public OleDb object. Here
the source:
>
Quote:
Quote:
Public DatabaseConnection As New OleDb.OleDbConnection
>
Quote:
Quote:
This error only happens, when I try to fill up the ConnectionString of
this OleDb Object.
>
Quote:
Quote:
The error message itself is not really helpful, so I won't post it
right now.
>
Quote:
Quote:
My Question is: Where is the problem, is there someone which had
similar problem with Vista and XP apps?
>
Quote:
Quote:
Thank you for your help.
>
Quote:
Quote:
--
pmw
>
Quote:
What's the error?- Zitierten Text ausblenden -
>
Quote:
- 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
Larry__Weiss
Guest
 
Posts: n/a
#5: Sep 22 '08

re: VB.NET app compiled in Vista does not work on XP


Lets see if I got this right

compile on XP, run on XP is OK
compile on XP, run on Vista is OK
compile on Vista, run on Vista is OK
but, compile on Vista, run on XP is NOT OK

- Larry


pmw wrote:
Quote:
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
PmW
Guest
 
Posts: n/a
#6: Sep 23 '08

re: VB.NET app compiled in Vista does not work on XP


On 22 Sep., 17:45, kimiraikkonen <kimiraikkone...@gmail.comwrote:
Quote:
>Sorry, without seeing full code (if it's not too long), i can't make
>out the reason beyond guessing the following:
Sorry, I would love to give you the source code, but I can't. Not
because it's big, I just can't hand you over that code.
Quote:
>1)Make sure you are using proper connection string syntax. Look at http://www.connectionstrings.com for more info.
That one has to be allright, because on Vista it works with the same
one. I also checked it by creating an *.udl file on the XP machine to
create the string.
Quote:
>2)Try to put your code inside a Try-Catch block and catch the actual r
>error if it provides additional clue. [...]
Already did that. There isn't really a good error message for that ...
makes it even harder to understand the problem.
Quote:
>3)Try to initialize your disposable OleDb class within Using-End Using
>to ensure there's no pending open connections.
Problem 1: I can't use "Using-End Using" with "OleDB.OleDbConnection".
Problem 2: I'm using the object all over the application, so it has to
be a public one, declared in a module. (like I'm doing it right now).

Thank you anyway for your help! I really appreciate that.

PmW
Guest
 
Posts: n/a
#7: Sep 23 '08

re: VB.NET app compiled in Vista does not work on XP


On 22 Sep., 23:19, Larry__Weiss <l...@airmail.netwrote:
Quote:
compile on XP, run on XP is OK
True
Quote:
compile on XP, run on Vista is OK
Not sure, didn't try that. But I expect that it is running on Vista.
Quote:
compile on Vista, run on Vista is OK
True
Quote:
but, compile on Vista, run on XP is NOT OK
True

--
PmW
dgcarter1949@googlemail.com
Guest
 
Posts: n/a
#8: Sep 23 '08

re: VB.NET app compiled in Vista does not work on XP


On Sep 23, 7:01*am, PmW <we...@see64.chwrote:
Quote:
On 22 Sep., 17:45, kimiraikkonen <kimiraikkone...@gmail.comwrote:>Sorry, without seeing full code (if it's not too long), i can't make
Quote:
out the reason beyond guessing the following:
>
Sorry, I would love to give you the source code, but I can't. Not
because it's big, I just can't hand you over that code.
>
Quote:
1)Make sure you are using proper connection string syntax. Look athttp://www.connectionstrings.comfor more info.
>
That one has to be allright, because on Vista it works with the same
one. I also checked it by creating an *.udl file on the XP machine to
create the string.
>
Quote:
2)Try to put your code inside a Try-Catch block and catch the actual r
error if it provides additional clue. [...]
>
Already did that. There isn't really a good error message for that ...
makes it even harder to understand the problem.
>
Quote:
3)Try to initialize your disposable OleDb class within Using-End Using
to ensure there's no pending open connections.
>
Problem 1: I can't use "Using-End Using" with "OleDB.OleDbConnection".
Problem 2: I'm using the object all over the application, so it has to
be a public one, declared in a module. (like I'm doing it right now).
>
Thank you anyway for your help! I really appreciate that.
So you want help solving this problem but can't show us the code
that's causing it. Call me an old cynic, but that sounds like I've
got this homework please do it for me.
PmW
Guest
 
Posts: n/a
#9: Sep 23 '08

re: VB.NET app compiled in Vista does not work on XP


On 23 Sep., 10:05, "dgcarter1...@googlemail.com"
<dgcarter1...@googlemail.comwrote:
Quote:
On Sep 23, 7:01*am, PmW <we...@see64.chwrote:
>
>
>
>
>
Quote:
On 22 Sep., 17:45, kimiraikkonen <kimiraikkone...@gmail.comwrote:>Sorry, without seeing full code (if it's not too long), i can't make
Quote:
>out the reason beyond guessing the following:
>
Quote:
Sorry, I would love to give you the source code, but I can't. Not
because it's big, I just can't hand you over that code.
>
Quote:
Quote:
>1)Make sure you are using proper connection string syntax. Look athttp://www.connectionstrings.comformore info.
>
Quote:
That one has to be allright, because on Vista it works with the same
one. I also checked it by creating an *.udl file on the XP machine to
create the string.
>
Quote:
Quote:
>2)Try to put your code inside a Try-Catch block and catch the actual r
>error if it provides additional clue. [...]
>
Quote:
Already did that. There isn't really a good error message for that ...
makes it even harder to understand the problem.
>
Quote:
Quote:
>3)Try to initialize your disposable OleDb class within Using-End Using
>to ensure there's no pending open connections.
>
Quote:
Problem 1: I can't use "Using-End Using" with "OleDB.OleDbConnection".
Problem 2: I'm using the object all over the application, so it has to
be a public one, declared in a module. (like I'm doing it right now).
>
Quote:
Thank you anyway for your help! I really appreciate that.
>
So you want help solving this problem but can't show us the code
that's causing it. *Call me an old cynic, but that sounds like I've
got this homework please do it for me.- Zitierten Text ausblenden -
>
- Zitierten Text anzeigen -
Err ... yeah sure ...

So you want to know why I can't show you the code? First it is a
commercial product, so I can't just show you some source codes without
permission. Second, I'm working in a workplace where I have to go
through 4 security doors. So now you can imagine, that I'm not just
working at a standard workplace. Two good reasons, why I can't show
you the sources.
Larry__Weiss
Guest
 
Posts: n/a
#10: Sep 23 '08

re: VB.NET app compiled in Vista does not work on XP


pmw wrote:
Quote:
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.
Is there any way you can compare the IL code generated from the Vista
and XP compiled code?

- Larry
pmw
Guest
 
Posts: n/a
#11: Sep 23 '08

re: VB.NET app compiled in Vista does not work on XP


On 23 Sep., 10:59, Larry__Weiss <l...@airmail.netwrote:
Quote:
pmw wrote:
Quote:
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.
>
Is there any way you can compare the IL code generated from the Vista
and XP compiled code?
>
* - Larry
There would be a way, if you can tell me how I can do that. Because I
don't know what you mean by "comparing IL code". It would be very nice
if you could help me.

--
pmw
=?Utf-8?B?S2VycnkgTW9vcm1hbg==?=
Guest
 
Posts: n/a
#12: Sep 23 '08

re: VB.NET app compiled in Vista does not work on XP


PmW,

Perhaps you could re-create the problem with a simple piece of code that did
not involve company secrets. You could then post that code.

A question: what techniques are you using to protect this commercial code
from being "de-compiled", since this is trivially easy to do with any code
written in .net or java?

Kerry Moorman


"PmW" wrote:
Quote:
>
So you want to know why I can't show you the code? First it is a
commercial product, so I can't just show you some source codes without
permission. Second, I'm working in a workplace where I have to go
through 4 security doors. So now you can imagine, that I'm not just
working at a standard workplace. Two good reasons, why I can't show
you the sources.
>
Larry__Weiss
Guest
 
Posts: n/a
#13: Sep 23 '08

re: VB.NET app compiled in Vista does not work on XP


pmw wrote:
Quote:
On 23 Sep., 10:59, Larry wrote:
Quote:
>pmw wrote:
Quote:
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.
>>
>Is there any way you can compare the IL code generated from the Vista
>and XP compiled code?
>>
There would be a way, if you can tell me how I can do that. Because I
don't know what you mean by "comparing IL code". It would be very nice
if you could help me.
>
start by reading the instructions in
http://windowsclient.net/blogs/faqs/...y-into-il.aspx

the full usage spec for ildasm.exe is at
http://msdn.microsoft.com/en-us/libr...k1(VS.80).aspx

- Larry
pmw
Guest
 
Posts: n/a
#14: Sep 23 '08

re: VB.NET app compiled in Vista does not work on XP


On 23 Sep., 15:43, Kerry Moorman
<KerryMoor...@discussions.microsoft.comwrote:
Quote:
PmW,
>
Perhaps you could re-create the problem with a simple piece of code that did
not involve company secrets. You could then post that code.
>
A question: what techniques are you using to protect this commercial code
from being *"de-compiled", since this is trivially easy to do with any code
written in .net or java?
>
Kerry Moorman
- Zitierten Text anzeigen -
Thats a good idea. I will try to recreate a similar project, which
uses the same objects.

This application is not for normal clients. It will only be used by
companies and people which do work in the same business. So they don't
even have interessts in getting the source code by decompiling it.
They can have it if they ask me.

--
wenga
pmw
Guest
 
Posts: n/a
#15: Sep 23 '08

re: VB.NET app compiled in Vista does not work on XP


On 23 Sep., 15:49, Larry__Weiss <l...@airmail.netwrote:
Quote:
start by reading the instructions inhttp://windowsclient.net/blogs/faqs/archive/2006/05/26/how-do-i-disas...
>
the full usage spec for ildasm.exe is athttp://msdn.microsoft.com/en-us/library/f7dy01k1(VS.80).aspx
>
* - Larry- Zitierten Text ausblenden -
>
- Zitierten Text anzeigen -
Thank you very much, I will try this tomorrow and give you a feedback.

--
pmw
pmw
Guest
 
Posts: n/a
#16: Sep 23 '08

re: VB.NET app compiled in Vista does not work on XP


On 23 Sep., 15:43, Kerry Moorman
<KerryMoor...@discussions.microsoft.comwrote:
Quote:
PmW,
>
Perhaps you could re-create the problem with a simple piece of code that did
not involve company secrets. You could then post that code.
>
A question: what techniques are you using to protect this commercial code
from being *"de-compiled", since this is trivially easy to do with any code
written in .net or java?
>
Kerry Moorman
- Zitierten Text anzeigen -
Thats a good idea. I will try to recreate a similar project, which
uses the same objects.

This application is not for normal clients. It will only be used by
companies and people which do work in the same business. So they
don't
even have interessts in getting the source code by decompiling it.
They can have it if they ask me.

--
pmw
kimiraikkonen
Guest
 
Posts: n/a
#17: Sep 23 '08

re: VB.NET app compiled in Vista does not work on XP


On Sep 23, 5:00*pm, pmw <pmw2...@gmail.comwrote:
Quote:
On 23 Sep., 15:43, Kerry Moorman
>
<KerryMoor...@discussions.microsoft.comwrote:
Quote:
PmW,
>
Quote:
Perhaps you could re-create the problem with a simple piece of code that did
not involve company secrets. You could then post that code.
>
Quote:
A question: what techniques are you using to protect this commercial code
from being *"de-compiled", since this is trivially easy to do with any code
written in .net or java?
>
Quote:
Kerry Moorman
- Zitierten Text anzeigen -
>
Thats a good idea. I will try to recreate a similar project, which
uses the same objects.
>
This application is not for normal clients. It will only be used by
companies and people which do work in the same business. So they
don't
even have interessts in getting the source code by decompiling it.
They can have it if they ask me.
>
--
pmw
Pmw,
You can also consider re-building project and and starting a new
project from the scratch and create all the source code files manually
(files that are in solution explorer) by right clicking solution
explorer -add -new item, then copy-paste the required codes from
your previous (problematic one) project into the new one.

Plus, if you're using settings file (My.Settings) you can re-create it
for the possibility of corruption.

Worth to try.

HTH,

Onur Güzel
pmw
Guest
 
Posts: n/a
#18: Sep 24 '08

re: VB.NET app compiled in Vista does not work on XP


On 23 Sep., 17:12, kimiraikkonen <kimiraikkone...@gmail.comwrote:
Quote:
On Sep 23, 5:00*pm, pmw <pmw2...@gmail.comwrote:
>
>
>
>
>
Quote:
On 23 Sep., 15:43, Kerry Moorman
>
Quote:
<KerryMoor...@discussions.microsoft.comwrote:
Quote:
PmW,
>
Quote:
Quote:
Perhaps you could re-create the problem with a simple piece of code that did
not involve company secrets. You could then post that code.
>
Quote:
Quote:
A question: what techniques are you using to protect this commercial code
from being *"de-compiled", since this is trivially easy to do with any code
written in .net or java?
>
Quote:
Quote:
Kerry Moorman
- Zitierten Text anzeigen -
>
Quote:
Thats a good idea. I will try to recreate a similar project, which
uses the same objects.
>
Quote:
This application is not for normal clients. It will only be used by
companies and people which do work in the same business. So they
don't
even have interessts in getting the source code by decompiling it.
They can have it if they ask me.
>
Quote:
--
pmw
>
Pmw,
You can also consider re-building project and and starting a new
project from the scratch and create all the source code files manually
(files that are in solution explorer) by right clicking solution
explorer -add -new item, then copy-paste the required codes from
your previous (problematic one) project into the new one.
>
Plus, if you're using settings file (My.Settings) you can re-create it
for the possibility of corruption.
>
Worth to try.
>
HTH,
>
Onur Güzel- Zitierten Text ausblenden -
>
- Zitierten Text anzeigen -
I just now tested the OleDB object with a different, prototype
project. I don't have any problems there. It might be that the current
project is damaged. I will now try to copy the sources to a new
project. I hope it's going to help.

I will report back.

--
pmw
pmw
Guest
 
Posts: n/a
#19: Sep 24 '08

re: VB.NET app compiled in Vista does not work on XP


On 22 Sep., 15:00, pmw <we...@see64.chwrote:
Quote:
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
Problem solved! It really was a damaged project file. Copied now all
the sources to a complete new project, and now it works ... don't ask
me why.

Thank you all very much for your help!

--
pmw
kimiraikkonen
Guest
 
Posts: n/a
#20: Sep 24 '08

re: VB.NET app compiled in Vista does not work on XP


On Sep 24, 2:43*pm, pmw <pmw2...@gmail.comwrote:
Quote:
On 22 Sep., 15:00, pmw <we...@see64.chwrote:
>
>
>
>
>
Quote:
Hi
>
Quote:
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.
>
Quote:
The thing is: I only have a virtual machine to test my software on XP,
but I can't develop on it.
>
Quote:
The error shows up, when I try to declare a public OleDb object. Here
the source:
>
Quote:
Public DatabaseConnection As New OleDb.OleDbConnection
>
Quote:
This error only happens, when I try to fill up the ConnectionString of
this OleDb Object.
>
Quote:
The error message itself is not really helpful, so I won't post it
right now.
>
Quote:
My Question is: Where is the problem, is there someone which had
similar problem with Vista and XP apps?
>
Quote:
Thank you for your help.
>
Quote:
--
pmw
>
Problem solved! It really was a damaged project file. Copied now all
the sources to a complete new project, and now it works ... don't ask
me why.
>
Thank you all very much for your help!
>
--
pmw- Hide quoted text -
>
- Show quoted text -
Cool. Thanks for the feedback, glad you solved.

Onur G.
Closed Thread