Huihong
Wed Aug 27 13:47:39 CDT 2003
You may want to try the following,
(1) disable the security, caspol -s off, then run your
app, if it is really a security thing, your app should run.
Turn the security back on, caspol -s on
(2) if your assembly is strong named, is it possible that
the assembly is tampered? use peverify to do a check
(3) Since the exception was thrown during loading, you can
write a simple test to load your assembly dynamically,
e.g., this way, you have control on the loading process
try {
Assembly.LoadFrom("your.dll");
// here you invoke some method
....
} catch (Exception e) {
Console.WriteLine(e.StackTrace);
}
(4) most likely, the security exception is thrown during
jitting some method, you can check wether there is any
declarative security permissions by names such
as "LinktimeDemand", use permview /decl your.dll to see
all permissions. Comment those out, and re-try your app
(5) if you are willing to send me your files, I can send
you a log of the methods jitted, etc. We have an internal
tool that logs all method jitting, invocation, strings,
etc. with lots of verbose information
Huihong
http://www.remotesoft.com
.NET code decompiler, obfuscator, protector, linker and
native compiler
>-----Original Message-----
>I have an assembly that fails to run because of some
SecurityException
>related to my permission settings. I *really* want to
figure out why the
>failure occurs, but when I debug in VS.Net, it happens so
early (during
>loading) that I cannot step into code to look at the
stack trace. The only
>thing I can know is that it's a SecurityException; no
watching of the
>exception object because I never get to my own code. Is
there any way to
>debug this? I can't even get another process to attach a
debug session to,
>so I would even take doing something like java where I
go "java
>myassembly.exe -verbose"...anything with some kind of
verbose logging.
>
>
>.
>