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)
Jochen Kalmbach - 26 Sep 2004 17:00 GMT
=?Utf-8?B?U3RlcGhlbiBSLiBHLiBGcmFzZXI=?= wrote:
> 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.
Is your code executed from a local drive?
I guess not!

Signature
Greetings
Jochen
My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Stephen R. G. Fraser - 26 Sep 2004 19:05 GMT
Hmmm interesting.
I'm running it from my C: drive but I am using a mapping to it. Subst does
work though.
Thanks!
> =?Utf-8?B?U3RlcGhlbiBSLiBHLiBGcmFzZXI=?= wrote:
>
[quoted text clipped - 4 lines]
> Is your code executed from a local drive?
> I guess not!