J
jwgoerlich
I wrote a simple VB.Net console application. It accepts command line
parameters and creates a folder structure. It works on the local file
system without a problem
If I run the console app from a UNC or network share, I get a
SecurityException on the following line:
Dim args() As String = Environment.GetCommandLineArgs()
Has anyone seen this before? Is there something special I need to do
for console applications on UNC paths?
Thanks in advance,
J Wolfgang Goerlich
Here is the complete exception text:
System.Security.SecurityException
System.Security.SecurityException: Request for the permission of type
System.Security.Permissions.EnvironmentPermission, mscorlib,
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed.
at System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet
grantedSet, PermissionSet deniedSet, CodeAccessPermission demand,
PermissionToken permToken)
at System.Security.CodeAccessSecurityEngine.Check(PermissionToken
permToken, CodeAccessPermission demand, StackCrawlMark& stackMark,
Int32 checkFrames, Int32 unrestrictedOverride)
at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission
cap, StackCrawlMark& stackMark)
at System.Security.CodeAccessPermission.Demand()
at System.Environment.GetCommandLineArgs()
at VerifyFolder.Module1.Main() in C:\Documents and
Settings\jwgoerlich\My Documents\Visual Studio
Projects\VerifyFolder\Module1.vb:line 12
parameters and creates a folder structure. It works on the local file
system without a problem
If I run the console app from a UNC or network share, I get a
SecurityException on the following line:
Dim args() As String = Environment.GetCommandLineArgs()
Has anyone seen this before? Is there something special I need to do
for console applications on UNC paths?
Thanks in advance,
J Wolfgang Goerlich
Here is the complete exception text:
System.Security.SecurityException
System.Security.SecurityException: Request for the permission of type
System.Security.Permissions.EnvironmentPermission, mscorlib,
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed.
at System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet
grantedSet, PermissionSet deniedSet, CodeAccessPermission demand,
PermissionToken permToken)
at System.Security.CodeAccessSecurityEngine.Check(PermissionToken
permToken, CodeAccessPermission demand, StackCrawlMark& stackMark,
Int32 checkFrames, Int32 unrestrictedOverride)
at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission
cap, StackCrawlMark& stackMark)
at System.Security.CodeAccessPermission.Demand()
at System.Environment.GetCommandLineArgs()
at VerifyFolder.Module1.Main() in C:\Documents and
Settings\jwgoerlich\My Documents\Visual Studio
Projects\VerifyFolder\Module1.vb:line 12