473,804 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Assembly loading

I am writing a server and an MMC console app that use remoting to talk
to each other. The MMC client and the server share a couple of
assemblies: one has the interface that is remoted from the server and
the other has some data structures that are passed across the remoted
interface from the server to the client. These assemblies are not
strong named and are not entered in the GAC. I could easily solve
this problem by putting the DLL in the System32 directory or in the
GAC, but I am trying to understand why it won't load one of the DLLs.

The directories are setup like this:

Machine A
\Program Files\Server\Se rver.exe
\Program Files\Server\Re mote.dll
\Program Files\Server\Da taStructs.dll

Machine B
\Program Files\Client\MM CSnapin.dll
\Program Files\Client\Re mote.dll
\Program Files\Client\Da taStructs.dll

The server runs on Machine A as expected. The MMC console runs on B
with the following problem: it loads the MMCSnapin.dll and Remote.dll
just fine but it can't load DataStructs.dll or atleast it thinks it
can't. I put a breakpoint in the MMCSnapin.dll where it creates the
remoted interface. At that point, I look at the Debug/Modules window
and I see all 3 DLL's loaded. I can even create objects from the
DataStructs.dll with no problem. The problem occurs when I call a
method on the remoted interface that returns one of the objects from
DataStructs.dll . The method throws an exception and says it can't
find the assembly, even though the Modules window says that it is
already loaded. I also checked
AppDomain.Curre ntDomain.GetAss emblies() and the DataStructs.dll
assembly is there as it should be.

If I put the DataStructs.dll in the System32 directory where MMC.exe
is, it loads the assembly just fine and calls the remoted method
correctly. I suspect it would behave correctly if I put the assembly
into the GAC as well. But right now, my question is: why does the
Modules window say the assembly is loaded but calling the remoted
method cause it to not be able to find the assembly? I have
repeatedly compiled all components and scoured my drive to make sure
the are no outdated assemblies floating around to confuse things.

Thanks
Kent Rollins
Jul 21 '05 #1
1 1981
Hi,

your MMC client is acting as part of the MMC proceess, and it's working
directory is System32. You can capture the AppDomain.Assem blyResolve
event, and there to load the assembly you need from where it is.

Sunny
In article <61************ *************** *****@4ax.com>,
sp******@spamfr ee.com says...
I am writing a server and an MMC console app that use remoting to talk
to each other. The MMC client and the server share a couple of
assemblies: one has the interface that is remoted from the server and
the other has some data structures that are passed across the remoted
interface from the server to the client. These assemblies are not
strong named and are not entered in the GAC. I could easily solve
this problem by putting the DLL in the System32 directory or in the
GAC, but I am trying to understand why it won't load one of the DLLs.

The directories are setup like this:

Machine A
\Program Files\Server\Se rver.exe
\Program Files\Server\Re mote.dll
\Program Files\Server\Da taStructs.dll

Machine B
\Program Files\Client\MM CSnapin.dll
\Program Files\Client\Re mote.dll
\Program Files\Client\Da taStructs.dll

The server runs on Machine A as expected. The MMC console runs on B
with the following problem: it loads the MMCSnapin.dll and Remote.dll
just fine but it can't load DataStructs.dll or atleast it thinks it
can't. I put a breakpoint in the MMCSnapin.dll where it creates the
remoted interface. At that point, I look at the Debug/Modules window
and I see all 3 DLL's loaded. I can even create objects from the
DataStructs.dll with no problem. The problem occurs when I call a
method on the remoted interface that returns one of the objects from
DataStructs.dll . The method throws an exception and says it can't
find the assembly, even though the Modules window says that it is
already loaded. I also checked
AppDomain.Curre ntDomain.GetAss emblies() and the DataStructs.dll
assembly is there as it should be.

If I put the DataStructs.dll in the System32 directory where MMC.exe
is, it loads the assembly just fine and calls the remoted method
correctly. I suspect it would behave correctly if I put the assembly
into the GAC as well. But right now, my question is: why does the
Modules window say the assembly is loaded but calling the remoted
method cause it to not be able to find the assembly? I have
repeatedly compiled all components and scoured my drive to make sure
the are no outdated assemblies floating around to confuse things.

Thanks
Kent Rollins

Jul 21 '05 #2

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

Similar topics

4
2886
by: Arnaud Debaene | last post by:
Hello group. I have an app which can load "plugins" assemblies that are described in the registry (each registry entry gives the full path to the plugin ..dll file). The plugins may be anywhere on the disk. Each plugin defines a class which implements an interface known to the app. The main app loads the plugin with Assembly.LoadFrom and then uses Assembly.GetTypes() and Type.FindInterface to find the concrete types in the plugin that...
3
2579
by: Atul Godbole | last post by:
Suppose an assembly "Main" is using class "A" from another Assembly "Dep" as follows : A a = new A(); a.MethodOne(); At what time is the call to MethodOne linked to the actual MSIL (method body) of the method? Does this occur when "Main" is build or does it happen when main is loaded and Jitted? Also is the linking achieved by the full method name( this is what is seen in the IL generated by ILDASM : e.g : call
4
2880
by: Mark | last post by:
I wan't to be able to deserialize a class from an assembly that is not in the application domain. To do that I must have the Type from the Assembly. How do you get a Type from an assembly that is not in the manifest of the current AppDomain. I have tried different ways but get exceptions from all of them that say the: assembly or one of its dependancies could not be found. There must be missing something.
2
4349
by: Sam Martin | last post by:
Morning all, Right, I've read untold articles now, listening to people bitch about there being no Unload method for Assembly. Plenty of people do counter that this is possible by loading the Assemblies into a seperate AppDomain and closing it when finish, which would suit me fine. However, I have been able to find an example.
1
5022
by: Benjamin | last post by:
Hi, I'm currently writing a Web Services that interacts with a database. To allow me to use not just one database provider (for example, I could use MS Access, SQL Server or MySQL), the Web Service dynamically loads up an assembly that implements an Interface I called IDatabase. To load the assembly and create an object, I wrote this function: private IDatabase LoadDatabasePlugin( string assemblyFile, string
1
2931
by: Brian | last post by:
I've looked through the previous posts on this one and have verified permissions and location of my Dlls, but I am still getting an exception when I try to Load an assembly. The directory where my Dlls are located give the ASPNET user full control, and all Dlls used by the Assembly in question are in the local folder with the rest of the web application Dlls. Could someone take a look at my error and shed some light on this?
1
5419
by: realgeek | last post by:
Hi. I am writing a class lib that has com interop enabled and it is housed and used within some other application. So then, I serialize one of the classes, and on subsequent launches I try to deserealize them. That's when I get SerializatonException: cannot find the assembly (my assembly)". I tried loading the assembly at runtime, but it still won't work; Howervr, I noticed that the version number in the exception and in the...
2
4970
by: peter.drienovsky | last post by:
Hello, let me describe my problem: ENVIRONMENT: ..Net 2.0, MSVS 2005, c#, WinXP SYMPTOMS: If assembly 'AgentDesktop' IS NOT in the (loading) application folder,
2
2035
by: Chen Zhuo | last post by:
Hi all experts, We are having a problem with the exact time when a C# dll gets loaded in managed C++. The scenario is like: In managed.cpp: #using MyCSharp.dll
7
10088
by: chage | last post by:
Hi, I have been searching around to try adding reference assembly to another assembly during runtime, programatically. Is this possible in .Net? The reason for this is because i am having trouble using a library that creates an instance of a Type that i specified, and it failed the locate the Type during runtime, if i do not reference it during compile time.
0
9714
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
9594
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
10600
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
10350
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...
1
10351
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10096
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...
1
4311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3834
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
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.