.exe throws exception from local, but not network drive

F

frostalicious

Used VB.NET (on my client PC) to convert VB6 executable
to .NET executable. Placed the .exe file on a network drive
on my server. From client, ran .NET Wizards "Trust an
Assembly" to make the .exe (on the network drive, on the
server) "Full Trust." From the client, double-click on the
..exe (on the network drive, on the server) and it runs fine.

So far, so good, but...

On the server, where I've installed not VB.NET but .NET
Framework 1.1, ran Microsoft .NET Framework 1.1 Wizards
"Trust an Assembly" to make the .exe (on the local hard
drive of the server, not a network drive) "Full Trust," which
sticks, but when I double-click on the .exe (on the server,
on the local hard drive) CLR Debugging Services gives
"Application has generated an exception that could not
be handled." Any advice on how to debug this, from the
server, where VB.NET is not installed, would be appreciated.

I suspect the exception is System.Security.SecurityException
but don't know where to put Try/Catch/End code, as the
exception is thrown before the form loads, and don't know
how to invoke the JIT debugger on the server.

BTW Server is Win2K Pro; client is XP Home.
Any suggestions? I'm new to .NET and haven't got .NET
security figured out (as if you couldn't tell.) The VB6 version
of the .exe ran fine, wherever I put it, local hard drive or network
drive. The application uses File System Object, if that's a clue.

-- frosty
 
F

frostalicious

Have enough rights on that server? Try with an admin account to run
the .exe

Thanks, but that was not the problem. Turns out the exception had
nothing to do with System.Security.SecurityException. By copying
DLL's from the client to the server, was able to get enough of the
debugger info, in a command prompt box, to determine it was another
missing DLL, namely Microsoft.VisualBasic.Compatibility.dll and when
I copied that DLL to the server, my app started to work.

I'm sure there's a better way to assure the dll in question gets distributed
with the .exe that is my app. Anybody know how this is supposed to
be done? Can it be done in VB.NET or do I need VS.NET?

-- frosty
 
J

Jay B. Harlow [MVP - Outlook]

frostalicious,
I'm sure there's a better way to assure the dll in question gets distributed
with the .exe that is my app. Anybody know how this is supposed to
be done? Can it be done in VB.NET or do I need VS.NET?

The Microsoft.VisualBasic.Compatibility.dll is not included with the
framework, you need to install it yourself.

My first advice is to avoid the Compatibility DLL if at all possible. If
that is not an option, then you may want to consider a Setup project to
ensure that all the components get installed, in the correct location.

Hope this helps
Jay
 
F

frostalicious

I would like to insure that all the components get installed, in the
correct location, yes. Could you elaborate on "consider a Setup
project" for me? I would also like to run the .exe on any system
with .net framework 1.1 installed, so if the compatibility dll is not
part of that setup (and it's not) then running the .exe without the
need for the compatibility dll would be preferred. Another thing
I don't know how to do. We are very much on the same page,
as far as strategy (which is encouraging to me!) but I need help
with tactics. I could live with sending each user a .exe and the
..dll file, but it's just so... tacky. And, presumably, unnecessary.

-- frosty
 
P

Phil Wilson

The documentation says about that DLL, article 318833.
"Note: These files are included with Microsoft Visual Basic .NET to assist with
the upgrade process. They are not intended for use in new project development. "

You should post what functionality is in there that you're using and see if you
can use something else instead. I've seen people using it because it has a
folder browser, but there is one of these in the 1.1 framework (there wasn't in
1.0).
 
F

frostalicious

I'm using SendKeys:

Assembly Microsoft.VisualBasic.Compatibility
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Microsoft.VisualBasic.Compatibi
lity.dll
Namespace Microsoft.VisualBasic.Compatibility.VB6
Member of: Microsoft.VisualBasic.Compatibility
Public Module Support
Member of: Microsoft.VisualBasic.Compatibility.VB6
Public Sub SendKeys(ByVal Keys As String, Optional ByVal Wait As
Boolean = False)
Member of: Microsoft.VisualBasic.Compatibility.VB6.Support

-- frosty

Phil said:
The documentation says about that DLL, article 318833.
"Note: These files are included with Microsoft Visual Basic .NET to
assist with the upgrade process. They are not intended for use in new
project development. "

You should post what functionality is in there that you're using and
see if you can use something else instead. I've seen people using it
because it has a folder browser, but there is one of these in the 1.1
framework (there wasn't in 1.0).
I would like to insure that all the components get installed, in the
correct location, yes. Could you elaborate on "consider a Setup
project" for me? I would also like to run the .exe on any system
with .net framework 1.1 installed, so if the compatibility dll is not
part of that setup (and it's not) then running the .exe without the
need for the compatibility dll would be preferred. Another thing
I don't know how to do. We are very much on the same page,
as far as strategy (which is encouraging to me!) but I need help
with tactics. I could live with sending each user a .exe and the
.dll file, but it's just so... tacky. And, presumably, unnecessary.

-- frosty
[snip]
[It] was another
missing DLL, namely Microsoft.VisualBasic.Compatibility.dll and
when I copied that DLL to the server, my app started to work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top