Getting strange behavior porting vb.net application to another machine

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

App is VB.NET, using adonet

When app runs from the build machine (where compiled) it runs great. If I move the exe file to a shared public drive (for deployment) I get errors whenever I try to instantiate an ADO object. I am trying to run the app from the same machine, but different (mapped network) drive

I have commented lines of code until the error dissappears and it's always on a line that constructs a new ADO object such as a SqlConnection or a SqlDataAdapter. Runs fine on another machine whether on a mapped drive or local drive

What gives? I don't even know where to begin.
 
Dim oCn As SqlConnection = Nothin
Dim oDA As SqlDataAdapter = New SqlDataAdapter(
Dim oDs As DataSet = New DataSet(
Dim oSqlParam As SqlParameter = Nothin
Dim oParam As Parameter = Nothin

oCn = Connect(

The code runs as expected on the build box, and a client box with the executable on the local drive. It does not work if I move the exe to a mapped drive and try to run it from the build box. It works on one client box from a mapped drive

Since this is only a test app to troubleshoot a much larger application that (tries to) run as a service, I need to know what is going on with this app

Could it be a framework versioning issue? Am I not deploying it properly? I though all you need to have is the framework and the executable. My code uses no COM components, it's all managed .NET code

help???
 
This is a security issue. By default, when you run programs remotely, they
run with a limited permission set, which does not include being able to make
database calls. I imagine, you should be seeing a security error, in which
case that would have been useful to mention for a correct diagnosis.

You would have to configure .NET security on your machine, to allow database
calls by programs that you are running from other machines.

If you log on to the remote box, and run it directly from there, it should
work properly.

Code said:
Dim oCn As SqlConnection = Nothing
Dim oDA As SqlDataAdapter = New SqlDataAdapter()
Dim oDs As DataSet = New DataSet()
Dim oSqlParam As SqlParameter = Nothing
Dim oParam As Parameter = Nothing

oCn = Connect()


The code runs as expected on the build box, and a client box with the
executable on the local drive. It does not work if I move the exe to a
mapped drive and try to run it from the build box. It works on one client
box from a mapped drive.
Since this is only a test app to troubleshoot a much larger application
that (tries to) run as a service, I need to know what is going on with this
app.
Could it be a framework versioning issue? Am I not deploying it properly?
I though all you need to have is the framework and the executable. My code
uses no COM components, it's all managed .NET code.
 
¤ App is VB.NET, using adonet.
¤
¤ When app runs from the build machine (where compiled) it runs great. If I move the exe file to a shared public drive (for deployment) I get errors whenever I try to instantiate an ADO object. I am trying to run the app from the same machine, but different (mapped network) drive.
¤
¤ I have commented lines of code until the error dissappears and it's always on a line that constructs a new ADO object such as a SqlConnection or a SqlDataAdapter. Runs fine on another machine whether on a mapped drive or local drive.
¤
¤ What gives? I don't even know where to begin.

You're encountering the built-in security mechanism of the .NET framework so you're going to have to
modify the security policies. See the following MS KB article:

How to deploy a .NET Framework application to run from a network location
http://support.microsoft.com/default.aspx?scid=kb;en-us;832742


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Back
Top