473,770 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

evil COM & reflection problem please help :(

I can't get my head around the following problem no matter how I try.
..NET 1.1, C#.
There's an assembly A that outputs a COM component.
It dynamically loads a class from assembly B using Activator (assembly
B is loaded from a file).
Assembly B uses a class from assembly C that sits in GAC; project B
references a dll in project C output folder to make this possible.
Everything works.

As soon as the version of assembly C changes, project B start
referencing the new version and everything breaks, when I call
activator.Creat eInstance in assembly A I get an error telling me it
cannot load the assembly C (even though the old version is in GAC and
they are 100% compartable).

How do I make the loader ignore versions and use the assembly from GAC
anyway?
Or, how do I reference the assembly right in the GAC?
Right now I have to reinstall assembly into GAC after each error and I
suspect there might be some problems on users' machines when I deploy.

Aug 9 '06 #1
1 1148
You have to be carefull with the dll versions of the new C assembly
versions.
..Net uses some rules to determine with version of dlls in CAG it'll loads.

See the msdn about assembly versions rules..
Another way is make a reference to a specific version of assembly, you can
do it in app.config.

[]'s
Oberdan

<re******@gmail .comwrote in message
news:11******** **************@ n13g2000cwa.goo glegroups.com.. .
>I can't get my head around the following problem no matter how I try.
.NET 1.1, C#.
There's an assembly A that outputs a COM component.
It dynamically loads a class from assembly B using Activator (assembly
B is loaded from a file).
Assembly B uses a class from assembly C that sits in GAC; project B
references a dll in project C output folder to make this possible.
Everything works.

As soon as the version of assembly C changes, project B start
referencing the new version and everything breaks, when I call
activator.Creat eInstance in assembly A I get an error telling me it
cannot load the assembly C (even though the old version is in GAC and
they are 100% compartable).

How do I make the loader ignore versions and use the assembly from GAC
anyway?
Or, how do I reference the assembly right in the GAC?
Right now I have to reinstall assembly into GAC after each error and I
suspect there might be some problems on users' machines when I deploy.

Aug 9 '06 #2

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

Similar topics

1
1347
by: phoenix | last post by:
Hello, I'm using the webbrowser control to display a webpage on my form. The first problem is the gets fired for every image which is completed as well. http://support.microsoft.com/?id=180366 describes a solution but I'm not able to port the if to C# : VB --- Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object,
12
8501
by: SJD | last post by:
I've just read Christoph Schittko's article on XmlSerializer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp . . . and very informative it is too. I, too, am getting nasty FileNotFound exceptions. I've read, and digested the article, and I think I've found a bug -- it's difficult to track, though it does happen often.
14
2597
by: vicky | last post by:
SUMMARY: THREE YEARS of and continuing MENTAL TORTURE, TERRORISM, SADISM and BLATANT human rights violations by FBI SADISTS and PERVERTS. Please SAVE this post on your hard disks or email account and also bookmark it because the FBI sadists are gonna force the websites to remove this posting for good. I posted this column to pretty much all "active newsgroups" three weeks ago but the FBI "ARM TWISTED" and "FORCED" google management to...
1
2626
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 experimenting a bit with what I need to do this and have the following code snippet. But first if I pass the assembly name and type to Activator.CreateInstance() it always fails. However if I walk my assembly and get a type value, the call to...
3
5353
by: Doug | last post by:
Does anyone know of a way that you can use System.Reflection.MethodInfo to get a list of methods within a class and NOT have it show the Get and Set methods of properties?
8
1649
by: paccala | last post by:
Ciao Being google-ing since hours and still I'm not able to solve my problem... I have following hierarchy: class A { public void myMethod(); }
2
6770
by: Shmuel Cohen | last post by:
I have a class holding some enumerated types, i.e., public class MyEnums { public enum DATA_ITEM {FIRST, SECOND, THIRD,FOURTH,FIFTH}; ... } And I have a class the contains data, for example:
7
10001
by: Clint Herron | last post by:
Howdy! I posted this question on CSharpCorner.com, but then realized I should probably post it on a more active newsgroup. This will be my only cross-post. I'm creating a game engine, and using CodeDOM for my scripting needs (I realize I could use yacc or something else, but I wanted to try using CodeDOM -- this is more of an exercise for me to learn this stuff). Well, I compile my in-game scripts just fine. See appendix A for my code
5
3722
by: Mercdev | last post by:
I have an ActiveX control inherited from UserControl. This control is hosted in IE(version 6 or later). How i can navigate IE from this control. I know that i need to obtain IWebBrowser2 interface and work with it, but i can't. Can someone show an example how to get IWebBroswer2 or way how is possible navigate IE?
0
5576
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
0
9617
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
9453
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
8929
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...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
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
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
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.