dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[DotGNU]Unhandled Exception: System.Security.Policy.PolicyException


From: Josh Boudreau
Subject: [DotGNU]Unhandled Exception: System.Security.Policy.PolicyException
Date: Sun, 24 Nov 2002 12:02:07 -0400 (AST)

Hi, when I try to run cscc compiled code on MS .NET i get an error saying:

"Unhandled Exception: System.Security.Policy.PolicyException: Unverifiable
assembly"

This test was done with a helloworld. cscc compiled code runs fine with
ilrun, and MS compiled helloworld runs fine with ilrun, but cscc to MS
doesn't.

My Linux system is Slackware 8.0 running 2.4.18 (i586)
The Windows system is Windows 2000 with .NET Framework v1.0.3705

MSDN states the following:
---
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemsecuritypolicypolicyexceptionclasstopic.asp)

The exception that is thrown when policy forbids code to run.
For a list of all members of this type, see PolicyException Members.

Thread Safety
Any public static (Shared in Visual Basic) members of this type are safe
for multithreaded operations. Any instance members are not guaranteed to
be thread safe.

Remarks
This exception is typically thrown when the code requests more permissions
than
the policy will grant or the policy is configured to prohibit running the
code.

PolicyException uses the HRESULT CORSEC_E_POLICY_EXCEPTION.

For a list of initial property values for an instance of PolicyException,
see the constructor.

Requirements
Namespace: System.Security.Policy

Assembly: Mscorlib (in Mscorlib.dll)
---

And Here's the output from the tests:

using System;
class HelloWorld
{
        public static void Main(string[] args)
        {
                Console.Write("Hello World\n");
        }
}


address@hidden:~% cscc -vv helloworld.cs -o helloworld.exe
/usr/local/lib/cscc/plugins/cscc-cs -D __CSCC__ -D RELEASE -J
/usr/local/lib/cscc/lib -L . -M /usr/local/lib/cscc/lib -f
target-assembly-name=helloworld -vv -o
helloworld.iltmp -- helloworld.cs
/usr/local/bin/ilasm -o helloworld.objtmp -f
target-assembly-name=helloworld --
helloworld.iltmp
ilalink -o helloworld.exe --format exe -f target-assembly-name=helloworld
-L . -L /usr/local/lib/cscc/lib -- helloworld.objtmp
address@hidden:~%


address@hidden:~% ilrun --version
ILRUN 0.4.8 - IL Program Runtime
address@hidden:~% ilrun helloworld.exe
Hello World
address@hidden:~%


H:\>helloworld.exe
Unhandled Exception: System.Security.Policy.PolicyException: Unverifiable
assembly
'H:\helloworld.exe' failed policy check.

-- 
Josh Boudreau
address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]