VS2008 *.reg file

A

AA2e72E

Is there a way to make VS2008 create a *.reg file when compiling a COM
Interrop DLL?

The compilation process creates the *.DLL file and registers it: it would be
useful to have the *.reg file to see the chanhes it makes to the Registry as
well as for deployment purposes.

Thanks.
 
P

Peter Duniho

AA2e72E said:
Is there a way to make VS2008 create a *.reg file when compiling a COM
Interrop DLL?

Not as far as I know.
The compilation process creates the *.DLL file and registers it: it would be
useful to have the *.reg file to see the chanhes it makes to the Registry as
well as for deployment purposes.

The DLL can self-register with regsvr32. You shouldn't need a .reg file
to register the DLL during deployment.

Pete
 
A

AA2e72E

regsvr32?

My experience is that you need to use

regasm my.dll /codebase

for the DLL (I did say COM Interop) to be available as a server.

There is an option to acquire the *.reg file with

regasm my.dll /codebase /regfile:mydll.reg

I was hoping for a way to get VS2008 to create the mydll.reg file, perhaps
in the release folder.
 
K

Konrad Neitzel

Hi!


regasm my.dll /codebase /regfile:mydll.reg
I was hoping for a way to get VS2008 to create the mydll.reg file, perhaps
in the release folder.

Just check the Build Events options of your project. Did you try to run that
command in the "Post-build event command line"?

That way I would add special commands that I want the System to do
automatically inside the build. And through "Edit Post-build ..." button you
get access to the Macros (which are simply a set of predefined variables).

Hope this helps a little.

Konrad
 
A

AA2e72E

Thanks for the hint Konrad.

I've never used build events: it is time for me to learn how to use them.
 
P

Peter Duniho

AA2e72E said:
regsvr32?

My experience is that you need to use

regasm my.dll /codebase

for the DLL (I did say COM Interop) to be available as a server.

That's fine. It's basically the same idea as regsvr32. The point being
that you can register the DLL without dealing with a .reg file.

If you want to use regasm to register your DLL, just do that as part of
your deployment.

Pete
 
A

AA2e72E

I specified as post build event (to be run on successful completion) as

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm
$(TargetDir)\$(TargetFileName) codebase /regfile:$(TargetDir)\mydll.reg

It worked! Thanks for the hint.
 
K

Konrad Neitzel

Hi!

AA2e72E said:
I specified as post build event (to be run on successful completion) as

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm
$(TargetDir)\$(TargetFileName) codebase
/regfile:$(TargetDir)\mydll.reg

It worked! Thanks for the hint.

Great that I could help you.

But when deploying the DLL you should keep in mind what Peter told you.
It is better to use the right installation way instead of simply adding
some registry keys (But you never said that you need the reg file for a
deployment. So maybe you can simply ignore this comment.)

Konrad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top