G
Guest
What do I have to set to get a VS.NET 2005 executable generated with the /clr
(without :safe) option to run from the command line.
using namespace System;
void main()
{
Console::WriteLine("Hi");
}
Compiled on the command line with:
cl /clr Test.cpp
I always get:
Unhandled Exception: System.IO.FileLoadException: Failed to grant required
minim
um permissions to assembly 'Test, Version=0.0.0.0, Culture=neutral, PublicKey
Token=null'.
File name: 'Test, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' --->
System.Security.Policy.PolicyException: Required permissions can not be
acquire
d.
at System.Security.SecurityManager.ResolvePolicy(Evidence evidence,
Permissio
nSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet&
den
ied, Boolean checkExecutionPermission)
at System.Security.SecurityManager.ResolvePolicy(Evidence evidence,
Permissio
nSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet&
den
ied, Int32& grantedIsUnrestricted, Boolean checkExecutionPermission)
(without :safe) option to run from the command line.
using namespace System;
void main()
{
Console::WriteLine("Hi");
}
Compiled on the command line with:
cl /clr Test.cpp
I always get:
Unhandled Exception: System.IO.FileLoadException: Failed to grant required
minim
um permissions to assembly 'Test, Version=0.0.0.0, Culture=neutral, PublicKey
Token=null'.
File name: 'Test, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' --->
System.Security.Policy.PolicyException: Required permissions can not be
acquire
d.
at System.Security.SecurityManager.ResolvePolicy(Evidence evidence,
Permissio
nSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet&
den
ied, Boolean checkExecutionPermission)
at System.Security.SecurityManager.ResolvePolicy(Evidence evidence,
Permissio
nSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet&
den
ied, Int32& grantedIsUnrestricted, Boolean checkExecutionPermission)