Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / September 2004

Tip: Looking for answers? Try searching our database.

compiling with only /clr generates error when run from command lin

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stephen R. G. Fraser - 26 Sep 2004 12:11 GMT
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!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.