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.

Re: Tool for viewing assembly load exception stack traces by Jip

Jip
Wed Aug 27 08:03:44 CDT 2003

will fuslogvw.exe help ?

It is located in SDK/V1.1/Bin folder under the VS .Net install folder. The
tool is also available with framework V1.0.

"Keith Patrick" <richard_keith_patrick@nospamhotmail.com> wrote in message
news:e2CCl$FbDHA.388@TK2MSFTNGP10.phx.gbl...
> 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.
>
>



Re: Tool for viewing assembly load exception stack traces by Keith

Keith
Wed Aug 27 09:49:00 CDT 2003

No, it didn't show any errors. It will only tell about why an assembly
can't be bound, but I think it's binding fine for me. The problem is that a
Windows Service cannot load because it refuses a permission (FileDialog in
this case) unrestricted. It will bind OK, but a security check fails, so
unfortunately, fuslogvw doesn't check for that.

"Jip from Paris" <jipfromparis@hotmail.com> wrote in message
news:OQi$DuJbDHA.2404@TK2MSFTNGP10.phx.gbl...
> will fuslogvw.exe help ?
>
> It is located in SDK/V1.1/Bin folder under the VS .Net install folder. The
> tool is also available with framework V1.0.
>
> "Keith Patrick" <richard_keith_patrick@nospamhotmail.com> wrote in message
> news:e2CCl$FbDHA.388@TK2MSFTNGP10.phx.gbl...
> > 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.
> >
> >
>
>



Re: Tool for viewing assembly load exception stack traces by Huihong

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.
>
>
>.
>