473,385 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

reflection: IO error on build when using reflectiononlyloadfrom

http://msdn2.microsoft.com/en-us/lib...yloadfrom.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...

Jul 27 '07 #1
1 2068
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]

Jul 27 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tim Werth | last post by:
I am trying to use reflection to add an event handler for the RowUpdated event of the OracleDataAdapter object (ODP.NET), but the same thing can be said for SqlDataAdapter if you only use...
6
by: Lars Nielsen | last post by:
Hi everybody, I've run into a problem when using the reflection assembly on COM objects and been browsing around the net for some while. Apparently a few has asked the same question though no...
1
by: Mike Malter | last post by:
I am just starting to work with reflection and I want to create a log that saves relevant information if a method call fails so I can call that method again later using reflection. I am...
1
by: g4685034 | last post by:
Hello, I develop a program to dump what are in an assembly using Reflection. I try both Assembly.LoadFile and Assembly.ReflectionOnlyLoadFrom. A problem is if a type of some field refers to...
0
by: knightrider | last post by:
I am trying to iterate through all of the assemblies in the share that is our production source code repository and gather information about the assemblies (number of classes and methods contained...
4
by: =?Utf-8?B?QUMgW01WUCBNT1NTXQ==?= | last post by:
Trying to use reflection to obtain the 4-part name of a strong named assembly (assembly, version, culture, publickeytoken) and immediately release the reference. I’m currently doing the...
7
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file...
5
by: Klaudiusz Bryja | last post by:
Hi, This is for NetCF 2.0. I need to create event handling code which using reflection. I have some parameters in XML which describe how event should be handled. I have code to create...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.