reflection: IO error on build when using reflectiononlyloadfrom

  • Thread starter Thread starter Boot2TheHead
  • Start date Start date
B

Boot2TheHead

http://msdn2.microsoft.com/en-us/library/system.reflection.assembly.reflectiononlyloadfrom.aspx

When I open an assembly using Assembly.ReflectionOnlyLoadFrom it loads
fine, but when I try to build that assembly (I'm using a winforms prog
to look at the assembly, VS to build it) I get an IO error on the
build. This seems a little counterintuitive. If I'm only reading it,
not executing code, why does it get locked down? And is there a way to
unlock it when I'm done looking at it? This seems to be a no-no but...
 
Read the articles Remarks-section. I guess that might solve your
problem.

[cit]
Dependencies are not automatically loaded into the reflection-only
context.
You cannot execute code from an assembly that has been loaded into the
reflection-only context. To execute the code, load the assembly with
the LoadFile method.
The assemblyFile parameter must refer to a URI without escape
characters. This method supplies escape characters for all invalid
characters in the URI.
The path specified for assemblyFile is relative to the current
directory. The assembly is loaded into the domain of the caller.
[/cit]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top