VB.net 2003 to VB.net 2005 Access Issue....

b3jsd73jfx

Active member
Joined
Mar 6, 2006
Messages
28
Programming Experience
1-3
Ok, I have a program that compiles and runs fine under visual studio.net 2003. I have copied this program to many other computers and it works fine. I recently upgraded to visual studio.net 2005 and the program runs fine on my computer. But when I try to run the program on another computer, I get an error. Here's the code that i'm having issues with:
VB.NET:
Public DB as String
Dim Reader As New IO.StreamReader("BrentDB.txt")
DB = Reader.ReadLine
Reader.Close()
Now I am running this on a network drive, but I've increased all security policies to Full Trust and I still cannot get it to work. The error I get is "Object reference not set to instance of an object". I know the error occurs on the Dim Reader as new IO.StreamReader line.
If I copy the files locally though, the program runs fine. The only thing is, I can't copy the files locally on the other computers because of how we run our work systems. Anyone have any ideas?
 

TechGnome

Well-known member
Joined
May 23, 2005
Messages
896
Programming Experience
10+
Since you upgraded to VS2005, it's probably now using the Framework 2.0 ..... you'll need to install it onto the other computers in order for it to work.

-tg
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
according to the code you posted, it's looking for the file that's in the same directory as the exe file, there's no networking (yet)
 

b3jsd73jfx

Active member
Joined
Mar 6, 2006
Messages
28
Programming Experience
1-3
Alright, so I found a solution but it's a crappy one. I'll also explain the situation a bit better.
I designed a program in VB.net 2003. I took the program and put it on our workplaces server. Every computer in the building can access the application now (I placed the DLL's & the .ocx's in the folder as well. I also make hte program register the OCX files if need be). The program ran completely fine like this.
I recently upgraded to VB.net 2005 so I upgraded the program as well. Now when I copy the program to the folder, I get an error and the program crashes (error is a system.systemexception or something like that).
However! If I copy the program, the DLL's and the OCX files locally to a computer, then I can run it fine and connect to the access database that it still located in that folder on our server.
I need to know how I can keep these files on the network server and still allow people to use it. I have increased everyone's .net security to Full Trust and that didn't fix the issue.
(Thanks for looking at the issue though)
 

TechGnome

Well-known member
Joined
May 23, 2005
Messages
896
Programming Experience
10+
And you are sure all clients have been upgraded to the new framework as well?

-tg
 

cjard

Well-known member
Joined
Apr 25, 2006
Messages
7,053
Programming Experience
10+
just so i get this right:

It works on your dev machine, you copied it to a fileserver and youre now trying to run it in a client machine that definitely has:

.net 2.0 framework installed
security policy changes to make it trusted FOR .NET 2 <--very important!!! 1.1 and 2.0 have different policy sets (you cant edit 2.0 policies with 1.1's editor)


note that the .net 2 policy eidtor is NOT instlaled with the framwork, but as part of a 300 megabyte sdk. Its possible to strip it out down to just the 3 files it actually is and regasm it on the client machine though, to get it on...
 
Top Bottom