473,385 Members | 1,769 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.

manually loaded assembly fails to find its referenced assemblies

Bob
For an assembly I manually load from a file, this code snippet:

For Each t As Type In asm.GetTypes
'do something
Next

generates this error message:

System.Reflection.ReflectionTypeLoadException: One or more of the types in the
assembly unable to load.
at System.Reflection.Module.GetTypesInternal(StackCra wlMark& stackMark)
at System.Reflection.Assembly.GetTypes()
at ....

So I thought, fine, before calling GetTypes I can manually load the referenced
assemblies because I already know where they are.

For Each refasmname As AssemblyName In asm.GetReferencedAssemblies
Try
Dim asmtoload As String = DirectoryLocation & refasmname.Name & ".dll"
asm.LoadFrom(asmtoload)
Catch
End Try
Next

Even if all referenced assemblies are found and loaded, though, this technique
doesn't work all the time and I'm not quite sure why. Is there some way I can
say, "hey, you, assembly! - go look *here* to resolve references you can't
find"?

thanks in advance for any help,

Bob

P.S. Using the GAC is not an option.
Nov 20 '05 #1
1 1233
Bob
This works when all the refereced assemblies that are not in the GAC are copied
locally in the project. I still can't figure out how to pass mutiple reference
paths to the AppDomain....

Dim domaininfo As New AppDomainSetup
domaininfo.ApplicationBase = "file:///" & FilePath
secDom = AppDomain.CreateDomain("SecondaryDomain", Nothing, domaininfo)

Please clue me in. I'm wasting a lot of time on this... :(

Bob
Nov 20 '05 #2

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

Similar topics

1
by: guxu | last post by:
I have a VB application referencing some C# dlls. Got new set of C# dll assemblies, now kept getting errors when I run my VB application. There were errors like assmbly reference mismatch. Also...
3
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here...
2
by: Lee | last post by:
Hi, I have an app that loads in assemblies at run-time using the Assembly.LoadFrom command. When I look at the list of assemblies using GetReferencedAssemblies, my loaded ones do not appear in...
2
by: christopher.watford | last post by:
I'm loading a plugin assembly using Activator.CreateInstanceFrom, and inside this assembly is a settings class which gets serialized to XML. The general code flow is as follows: ObjectHandle...
5
by: =?Utf-8?B?TWFydHluIEZld3RyZWxs?= | last post by:
From the amount of articles about this one I’m sure this gets asked a lot, but I haven’t yet found a succinct article which explains what is required in its entirety. I work using Visual...
2
by: Smithers | last post by:
I have a Windows Forms application that implements a plug-in architecture whereby required assemblies are identified and loaded dynamically. Here are the relevant classes: A = application =...
2
by: Smithers | last post by:
My ASP.NET Web app uses a few 3rd party assemblies. Just wondering when those are loaded into the Web app's AppDomain - and for how long do they stay loaded. Is an assembly loaded the first time...
1
by: Jordan S. | last post by:
I plan to load an assembly during application startup, and load that assembly via reflection (i.e., it isn't referenced in the application's assembly manifest). The assembly will be loaded into the...
2
by: Andrus | last post by:
I need compile in-memory assembly which references to other in-memory assembly. Compiling second assembly fails with error Line: 0 - Metadata file 'eed7li9m, Version=0.0.0.0, Culture=neutral,...
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: 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
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...
0
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,...
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.