Problem with OpenFile dialog

Hi all!

I am using VB 2005 to develop a small app that processes land parcel information. The program works very well when the .EXE is located on my station (WinXP SP2). When I place the app on a network share, the Browse button I coded no longer works. I click on the button and no OpenFile dialog appears. If I move the app back to my station, everything works great.

Are there any limitations to .NET functions when using mapped drives? Is there a service pack for the framework 2.0 to fix this problem? Is my code bad? I coded the same app in .NET 1.1 and the same problems occurs. Here is the code for the Browse button (in 2005).

PrivateSub btn_Browse_Click(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles btn_Browse.Click

'Declare the local variables
Dim ofdAsNew OpenFileDialog()
FALPath =
""

Try

'Define the OpenFileDialog to obtain the raw FAL data
ofd.InitialDirectory ="C:\"
ofd.Filter ="fichiers fal (*.FAL)|*.FAL"
ofd.FilterIndex = 1
ofd.RestoreDirectory =
True
ofd.Multiselect =False

If ofd.ShowDialog() = Windows.Forms.DialogResult.OKThen
FALPath = ofd.FileName
txt_FALPath.Text = FALPath
EndIf

Catch exAs Exception
'Insert the Exception Handling code
EndTry

EndSub

If anyone can help, I would be very grateful for the assistance.

Sean

[3155 byte] By [SeanK.Campbell] at [2007-12-21]
# 1
When you application is running on a network share the dot net framework automatically changes the security settings. You should be able to adjust the security settings for your application with caspol.exe
KenTucker at 2007-8-30 > top of Msdn Tech,Visual Basic,Visual Basic Language...
# 2

When accessing a Dotnet program from a location other than the local computer, you need to consider Code Access Security rights settings. This affects among other things IO rights.

Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx

jwooley at 2007-8-30 > top of Msdn Tech,Visual Basic,Visual Basic Language...
# 3

Thank you Ken and Jim,

I will read the documentation on the CASPOL utility but it sounds like the problem has been located. I am considering creating a self-extracting zip that will deliver the .EXE on each computer instead of sharing it on the network. Might be less of a hassle.

Sean

SeanK.Campbell at 2007-8-30 > top of Msdn Tech,Visual Basic,Visual Basic Language...
# 4

Seriously if your looking into deploying an application - look at clickonce deployment.

Its very simple to use and works well.

http://msdn.microsoft.com/netframework/windowsforms/learning/features/clickonce/

A much better approach than a self extracting zip as it enables easy updating.

Watch the following video for more info.

http://www.dnrtv.com/default.aspx?showID=8

spotty at 2007-8-30 > top of Msdn Tech,Visual Basic,Visual Basic Language...