.NET security exception

G

Guest

I get the following exception trying to open a folder using the
FolderBrowserDialog control in Visual Studio 2005. This only happens when the
code is running on a mapped drive. How can I avoid this?

System.Security.SecurityException occurred
Message="Request for the permission of type
'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."

Source="mscorlib"
StackTrace:
at System.Security.CodeAccessSecurityEngine.Check(Object demand,
StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.Windows.Forms.FolderBrowserDialog.get_SelectedPath()
at IfGen_Reader.Form1.openToolStripMenuItem_Click(Object sender,
EventArgs e)

Any help would be appreciated!
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,


IIRC the default install do not allow programs running from the network to
access the filesystem. You need to modify the permission from the Adm. tools
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Go to admin. tools and select .Net Wizard, select "Adjust .net security"
Put full trust to intranet
 

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