.NET Framework Bookmark and Share   
 index > .NET Base Class Library > how to GetTypes of dependenced assembly, which not in root directory
 

how to GetTypes of dependenced assembly, which not in root directory

I have an executing assembly, which needsload a specified assembly existed in a sub directory, just likes

executing assembly specified assembly (in a sub directory), i call it"subAssembly"
| |
|--------load assembly----------->|
| |

unfortunately, the specified assembly has a dependence of another assembly (i call it "DepAssembly") , which just exist in that sub directory, either. No same dependenced assembly exists in the root directory,

when I tried to invoke GetTypes methodof that "subAssembly", the CLR will throw an AssemblyLoadException, means it can not find the DepAssembly in the root directory.

I just do not want to copy the DepAssembly to the root directory, because the executing assembly has no any dependence of it, you guys got any idea for this?

Thanks so much in advance.

ps. I don't need install it into GAC either.

micyng
How did you load the sub assembly, via Assembly.LoadFrom?

If so, use my answer from this post earlier today:
http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/20d5f4dd-f4ac-4d47-af56-e301d7100e69
Adam Sills
Use the <probing> element in the app's .config file. AppDomain.AssemblyResolve to do it in code.

Hans Passant.
nobugz

You can use google to search for other answers

Custom Search

More Threads

• Problem with Format function
• Sorting a Collection
• .NET 2.0 Web apps on .NET 1.1 Server
• VB. NET decompiler
• service folder
• Application Setting value changes
• Copy a line at the end of a file without removing the data written before
• Page.Timeout in C# .NET
• .net 1.1 - datagrid -"endedit" problem
• String comparison problem