473,725 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reflection Issue / Question

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 in each).

My problem is that many of the assemblies reference other assemblies
that causes the call to myAssembly.GetT ypes() to fail with the
following error:
"Unable to load one or more of the requested types. Retrieve the
LoaderException s property for more information."
"Could not load type
'MyCompany.BizT alk.Contracting .ContractContro llerBase' from assembly
'ContractContro llers, Version=1.0.265 7.26442, Culture=neutral ,
PublicKeyToken= null'.
and
"Could not load file or assembly 'Microsoft.XLAN Gs.BaseTypes,
Version=3.0.1.0 , Culture=neutral , PublicKeyToken= 31bf3856ad364e3 5' or
one of its dependencies. The system cannot find the file specified."

For my purposes, I don't care about loading the assemblies that my
assembly depends on, I just want information about the "current"
assembly that I just loaded. I'm using Assembly.LoadFr om(fileName)
and have tried Assembly.Reflec tionOnlyLoadFro m(fileName), but neither
works for me. (side note: why doesn't ReflectionOnlyL oadFrom work
since it's not supposed to load the dependent assemblies?)

I want to know how to interrogate and assembly without having to have
all the dependent paths resolved. I know "Lutz Roeder's .NET
Reflector" can do this without resolving or loading the dependent
assemblies.

Any advice would be greatly appreciated.

May 9 '07 #1
0 1139

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

Similar topics

0
1377
by: A. Wiebenga | last post by:
Hi all! I am a student at the Hogeschool van Arnhem en Nijmegen in Holland. I am currently involved in a research project regarding Reflection. Purpose of the research project is to document what Reflection is (I can answer this question myself), what kind of Reflection Techniques there are (.NET Reflection, Python Reflection etc. I can answer this one myself too). The main question I need to answer is related to the implementation of...
8
16914
by: Robert W. | last post by:
I've almost completed building a Model-View-Controller but have run into a snag. When an event is fired on a form control I want to automatically updated the "connnected" property in the Model. This works fine if all of the properties are at the top (root level) of the model but I'd like to keep them in nested classes to organize them better. So, for example, part of my data model looks like this (simplified) : public class MainClass
2
7773
by: Jeff | last post by:
I am trying to dynamically load an assembly via reflection and then invoke a method of that assembly that will populate a custom type collection passed into the method byref. I am able to dynamically load both the DALC component (for the method call) and the Entity component (for the custom type collection to pass in), but I keep getting an error ( Message "Object type cannot be converted to target type.") when invoking the method. If I...
3
2328
by: HL | last post by:
The requirement is to send some information to other objects. The objects to whom the information has to be sent is not available at compile time. The names of the types (objects) will be provided through an external file in which case we can use reflection to create objects of that type at run time. Case 1: The methods of those types can be invoked through reflection. Case 2: The caller can publish certain events. The types (objects)...
20
27790
by: Shawnk | last post by:
I would like to get the class INSTANCE name (not type name) of an 'object'. I can get the object (l_obj_ref.GetType()) and then get the (l_obj_typ.Name) for the class name. I there any way of getting 'l_Fred_my_ins' out of the following. .... My_cls l_Fred_my_ins = new My_cls();
2
4245
by: Wiktor Zychla [C# MVP] | last post by:
Could anyone confirm/deny that following is a bug (or at least an "unexpected behaviour")? If this is not a bug, I would be glad for a short explanation or a workaround. Issue: A generic class, Base, with a constraint on the generic parameter. A generic class, RelTable, with a constraint on two generic parameters. A reflection code that just enumerates types, methods and methods'
5
1791
by: dmeglio | last post by:
I have an item that I placed on the clipboard as follows: Clipboard.SetDataObject(slide); slide is type SlideType. Now I'm trying to read the data from the clipboard doing: foreach (System.Type type in this.slideModules.Values) { if (Clipboard.GetDataObject().GetDataPresent(type)) {
4
2194
by: Per Bolmstedt | last post by:
(This question has been asked previously in this group, but I don't think it was ever really properly answered.) I want to use reflection - preferably - to find all Web Forms in my web site that inherit my base page class (which in turn inherits System.Web.UI.Page). Behold the following code: For Each asm As System.Reflection.Assembly In System.AppDomain.CurrentDomain.GetAssemblies() For Each mdl As System.Reflection.Module In...
11
1927
by: idoublepress | last post by:
Hi all, I've been struggling with an issue that I hope you can comment on or provide suggestions to. Our .NET 2.0 (VS2005) based product is crashing (when the user selects a particular feature on the UI) on Vista. It works fine on XP. In a nutshell: - user makes a selection on the UI - System.Reflection.MethodInfo.Invoke() calls into one of our .NET library dlls - Inside the library dll, System.Activator.CreateInstance() is called
0
8888
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9113
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8097
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.