Author Topic: VB.NET.exe wont run from network path?  (Read 4677 times)

0 Members and 1 Guest are viewing this topic.

BazzaCAD

  • Guest
VB.NET.exe wont run from network path?
« on: January 19, 2007, 01:48:05 PM »
I've made a simple VB.NET.exe project using the OLD MS Animation Control. (MSComCtl2.dll). When I build the project VS.NET creates the "Interop.MSComCtl2.dll & AxInterop.MSComCtl2.dll" files to deal with the COM stuff. When I run the EXE from my hard drive it runs fine. But when I copy the whole build folder (EXE & all DLL's) to a network folder it doesn't run. I just get the "Send error report" to MS screen with no error message. Any one know how to get this to run off a network path? My old VB6.exe w/ the Animation Control would run fine from a network path.

thx for the help.

P.S. The FileSystemWatcher wont fire when watching a network folder (UNC path) either. We have a Linux file sever, could this be causing the issues?

Chuck Gabriel

  • Guest
Re: VB.NET.exe wont run from network path?
« Reply #1 on: January 19, 2007, 02:01:20 PM »
Network shares are placed in a security zone with limited trust by default.  Look in Control Panel->Administrative Tools for the .NET configuration tools that will allow you to change the security zone settings.

As to the issue with FileSystemWatcher, I don't know the answer.  Sorry.

BazzaCAD

  • Guest
Re: VB.NET.exe wont run from network path?
« Reply #2 on: January 19, 2007, 03:11:41 PM »
Thx for the heads-up, I'm in .NET framework 2.0 Config., but I can't find anything on Network shares. Can you maybe point me a little further? thx.

Chuck Gabriel

  • Guest
Re: VB.NET.exe wont run from network path?
« Reply #3 on: January 19, 2007, 03:20:30 PM »
Sure.  In the treeview on the left, traverse down to "Runtime Security Policy."  Then, in the right-hand pane, click the link labeled "Adjust Zone Security."  You will be asked if you want the changes to apply to the machine or only the local user.  Choose whichever is appropriate for you, and click "Next."  Select "Local Intranet" on the dialog that appears next, and bump the trust level up until your program works.  Note, there may be good reasons for keeping the trust level low for the local intranet zone, so think carefully about how important it is that you be able to run your program from the network.

Good luck.

BazzaCAD

  • Guest
Re: VB.NET.exe wont run from network path?
« Reply #4 on: January 19, 2007, 03:28:26 PM »
Great thx, it worked. However so I don't have to change this setting on all my users PC's is there a way in my code to make it a trusted App. If not is there a RegEdit or something I can script if I do have to change this on all the users PC's?

Thx, again for the help.

BazzaCAD

  • Guest
Re: VB.NET.exe wont run from network path?
« Reply #5 on: January 19, 2007, 03:34:37 PM »
I guess I could copy this file "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\security.config" to all the PC's to change there security setting, but would still like to find a way to make my App. trusted without changing the setting.

Glenn R

  • Guest
Re: VB.NET.exe wont run from network path?
« Reply #6 on: January 24, 2007, 09:32:37 PM »
From memory, I believe you there is an option when changing the security settings to make an MSI installer of the changes you've made.

Once you have this, a system admin could roll this out to every user using active directory, group policy, logon batch file or a host of other methods.

Hope this helps.

Cheers,
Glenn.

MDONUT12

  • Guest
Re: VB.NET.exe wont run from network path?
« Reply #7 on: March 05, 2007, 11:20:59 AM »
From memory, I believe you there is an option when changing the security settings to make an MSI installer of the changes you've made.

Once you have this, a system admin could roll this out to every user using active directory, group policy, logon batch file or a host of other methods.

Hope this helps.

Cheers,
Glenn.

This has helped for XP stations. Does anyone know what should be set if I'm net loading dll's on Vista? Seems I can only get the DLL's to load if i place it on my desktop and net load from there?

Thanks for any help!! P.S. I did try the security settings for local intranets too.. Maybe vista is just too locked down right now?

Mark

BazzaCAD

  • Guest
Re: VB.NET.exe wont run from network path?
« Reply #8 on: March 05, 2007, 12:50:38 PM »
I'm not sure if this helps, but we added this line of code to our Win. log-on script to give all our users permission to run .NET from the network.

%windir%\Microsoft.NET\Framework\v2.0.50727\caspol -m -pp off -cg 1.2 FullTrust

For info on using caspol try
caspol /?

In particular, to see the settings for your groups, try
caspol -lg

1.2 should be FullTrust after running the command above.