K
Kevin
I have a Smart Client application that was written in .NET 1.1 long
before .NET 2.0 ever came out. It works great. It uses web services
and because we have many development environments, it dynamically gets
the base Url to construct the Url for the web services by simply
calling Application.ExecutablePath.
Like I said, this all works great on a computer with .NET 1.1 Framework
installed, but it now fails on a computer that has both .NET 1.1 and
recently installed .NET 2.0! So much for Microsoft's side by side
execution!
The error I get is as follows:
System.Security.SecurityException: Request for the permission of type
System.Security.Permissions.FileIOPermission, mscorlib,
Version=1.0.5000.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.Reflection.Assembly.VerifyCodeBaseDiscovery(String
codeBase)
at System.Reflection.Assembly.GetName(Boolean copiedName)
at System.Reflection.Assembly.GetName()
at System.Windows.Forms.Application.get_ExecutablePath()
I have tried all kinds of things, but trying to get at the launch Url
always fails with the FileIOPermission Security Exception.
I have tried several other things like:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms05152003.asp
But the following returns null:
AppDomain domain = AppDomain.CurrentDomain;
object obj = domain.GetData("APP_LAUNCH_URL");
string appLaunchUrl = (obj != null ? obj.ToString() : "");
And calling:
string configFile = domain.SetupInformation.ConfigurationFile;
Throws the same FileIOPermission Security Exception.
I also tried:
http://www.dotnet247.com/247reference/msgs/44/224782.aspx
But could not get it to work.
If anyone has any ideas they'd like to throw my way, I'd appreciate it.
before .NET 2.0 ever came out. It works great. It uses web services
and because we have many development environments, it dynamically gets
the base Url to construct the Url for the web services by simply
calling Application.ExecutablePath.
Like I said, this all works great on a computer with .NET 1.1 Framework
installed, but it now fails on a computer that has both .NET 1.1 and
recently installed .NET 2.0! So much for Microsoft's side by side
execution!
The error I get is as follows:
System.Security.SecurityException: Request for the permission of type
System.Security.Permissions.FileIOPermission, mscorlib,
Version=1.0.5000.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.Reflection.Assembly.VerifyCodeBaseDiscovery(String
codeBase)
at System.Reflection.Assembly.GetName(Boolean copiedName)
at System.Reflection.Assembly.GetName()
at System.Windows.Forms.Application.get_ExecutablePath()
I have tried all kinds of things, but trying to get at the launch Url
always fails with the FileIOPermission Security Exception.
I have tried several other things like:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms05152003.asp
But the following returns null:
AppDomain domain = AppDomain.CurrentDomain;
object obj = domain.GetData("APP_LAUNCH_URL");
string appLaunchUrl = (obj != null ? obj.ToString() : "");
And calling:
string configFile = domain.SetupInformation.ConfigurationFile;
Throws the same FileIOPermission Security Exception.
I also tried:
http://www.dotnet247.com/247reference/msgs/44/224782.aspx
But could not get it to work.
If anyone has any ideas they'd like to throw my way, I'd appreciate it.