473,547 Members | 2,532 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling Regsvr32 on a .NET Assembly

Fairly simple question !!!

The title says it all. But here is a further description -

I have a software that expects a COM DLL. Due to certain requirements we
have to create a .NET assembly instead.

I know we can do RegAsm, but the way we have to "load" this assembly into
another program is that ... the other program calls DllRegisterServ er on it
directly - (regsvr32 equivalent).

So my question is - How can we fake a .NET assembly so that regsvr32.exe
thinks it is indeed a COM DLL and we use it VIA RegSvr32 and not RegAsm.exe.

Regards,

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
http://blogs.apress.com/authors.php?author=Sahil Malik


Nov 16 '05 #1
2 4754
If you have access to MC++ you could always write a small DLL that uses the
RegistrationSer vices class in its DllRegisterServ er method, delegating to
the runtime to register the actual assembly.

And out of interest, how does it determine the CLSID of the object to
instantiate from the DLL you give it?

--
John Wood
Blog: http://spaces.msn.com/members/johnwood

"Sahil Malik" <co************ *****@nospam.co m> wrote in message
news:ur******** ********@TK2MSF TNGP14.phx.gbl. ..
Fairly simple question !!!

The title says it all. But here is a further description -

I have a software that expects a COM DLL. Due to certain requirements we
have to create a .NET assembly instead.

I know we can do RegAsm, but the way we have to "load" this assembly into
another program is that ... the other program calls DllRegisterServ er on it directly - (regsvr32 equivalent).

So my question is - How can we fake a .NET assembly so that regsvr32.exe
thinks it is indeed a COM DLL and we use it VIA RegSvr32 and not RegAsm.exe.
Regards,

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
http://blogs.apress.com/authors.php?author=Sahil Malik

Nov 16 '05 #2
John,

That was my recommended solution too, but I was wondering if we could keep
it withing C#.

To answer your question - It calls does regsvr32's job of registering it, -
then it is like any other com registered dll.

- Sahil Malik
You can reach me thru my blog -
http://www.dotnetjunkies.com/weblog/sahilmalik

"John Wood" <john.wood@prio rganize_nospam_ _.com> wrote in message
news:eZ******** ******@TK2MSFTN GP10.phx.gbl...
If you have access to MC++ you could always write a small DLL that uses
the
RegistrationSer vices class in its DllRegisterServ er method, delegating to
the runtime to register the actual assembly.

And out of interest, how does it determine the CLSID of the object to
instantiate from the DLL you give it?

--
John Wood
Blog: http://spaces.msn.com/members/johnwood

"Sahil Malik" <co************ *****@nospam.co m> wrote in message
news:ur******** ********@TK2MSF TNGP14.phx.gbl. ..
Fairly simple question !!!

The title says it all. But here is a further description -

I have a software that expects a COM DLL. Due to certain requirements we
have to create a .NET assembly instead.

I know we can do RegAsm, but the way we have to "load" this assembly into
another program is that ... the other program calls DllRegisterServ er on

it
directly - (regsvr32 equivalent).

So my question is - How can we fake a .NET assembly so that regsvr32.exe
thinks it is indeed a COM DLL and we use it VIA RegSvr32 and not

RegAsm.exe.

Regards,

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
http://blogs.apress.com/authors.php?author=Sahil Malik


Nov 16 '05 #3

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

Similar topics

1
10176
by: Martin Huseby Karlsen | last post by:
I made a dll in c++ to do some calculations, and i call it from vba ( for excel XP, also tried it fro access and excel 2000) Problem is that when i copy the dll to another PC and run the same vba code i get "run time error 53, dll file not found", on the pc where the dll i created everything works nice I've tried to register the dll with...
5
15346
by: Chris | last post by:
Hi I have a scenario where I've created another AppDomain to dynamically load a DLL(s) into. In this newly loaded DLL I want to call a static method on a class. The problem arise is that I have the same class/static method definition statictly linked to my EXE and when I call InvokeMember(...), even though I got the Type from the new AppDomain,...
2
3592
by: Grant Merwitz | last post by:
Hi We have just bought a product what has a classic ASP front end that uses 2 assemblies. These are registered with the following command: regsvr32 Repository.dll /s regsvr32 Dynu.dll /s The way they are used int the code is as follows: dim objUser
2
1629
by: Richard B | last post by:
I added a .NET dll as a reference to my new .NET dll. When I went to build, I received error "Unable to emit assembly: Referenced assembly 'CrystalReport' does not have a strong name". "CrystalReport" is a .NET dll I built which calls the third-party Crystal dll. I have no problem when I call the "CrystalReport" dll from my .NET...
2
3856
by: Genady Beryozkin | last post by:
I have a COM dll that defines a COM object. I used to register it either during link or using regsvr32. Now I have compiled one of the C++ files in the DLL with /clr so now I have a mixed DLL. The problem is that the DLL registration no longer works. Regsvr32 succeeds but the GUIDs of the COM objects no longer present in the registry and...
11
7970
by: =?Utf-8?B?Um9iS2lubmV5MQ==?= | last post by:
Hello, We are testing and tweaking some of our software to run on Vista, but it turns out that we are having problems with one of our programs. Here is our code: // attempt an experiment to register an OCX object in silient mode try {
1
1686
by: DR | last post by:
when i reference a com object by regsvr32 it then find it in the COM tab, it works ok. but when i reference a com object by referencing the .dll file i get this error in my C# application: Error 1 The "ResolveManifestFiles" task failed unexpectedly. System.ArgumentException: Illegal characters in path. at...
7
2667
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file name based on the name of the VB6 application. A second choice would be a file name based on the # COM interface assembly. I have tried calling...
8
1979
by: Derek Hart | last post by:
I am unclear about what all the requirements are to call a simple vb.net application, installed in the GAC, from COM (such as writing vba in Word to call the dotnet dll). I believe I have installed the dll in the GAC. It is in there and has a public token. I did not create a key-value pair. I believe it is strong named, as it shows up in...
0
7510
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...
0
7947
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...
0
7797
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...
0
6032
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...
1
5362
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...
0
5081
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...
1
1923
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
1
1050
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
748
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...

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.