Discussion:
Using C# dll as COM in an MFC application
(too old to reply)
Janiv Ratson
2006-08-17 17:17:31 UTC
Permalink
Hello,
I have written a C# dll in VS2005.
One interface and class are exported using Interop Services.
I want to use this c# dll in my MFC application, using VS2003.
It compiles after I imported the dll to my MFC app.
On runtime I get class not registered HR error in my MFC project.

I use the code as follow:
_NewActivationPtr myActivation = NULL;

HRESULT hr = myActivation.CreateInstance(__uuidof(NewSupernaActivation));

I don't what to do.

Do I have to use GACUtil to register?

If I want to use GACUtil do I have to sign my project?

Trying do it had failed, because my third party library I'm using in my C#
dll is not signed (so if I choose to sign my project, there is a compilation
error, caused because the 3rd party library is not signed, I guess).

Please help,

Thanks,

Janiv Ratson.
Ignacio Machin ( .NET/ C# MVP )
2006-08-17 19:07:43 UTC
Permalink
Hi,


In addition to DePalo post take a look at the latest number of MSDN
magazine, it has one article about that precise subject.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Post by Janiv Ratson
Hello,
I have written a C# dll in VS2005.
One interface and class are exported using Interop Services.
I want to use this c# dll in my MFC application, using VS2003.
It compiles after I imported the dll to my MFC app.
On runtime I get class not registered HR error in my MFC project.
_NewActivationPtr myActivation = NULL;
HRESULT hr = myActivation.CreateInstance(__uuidof(NewSupernaActivation));
I don't what to do.
Do I have to use GACUtil to register?
If I want to use GACUtil do I have to sign my project?
Trying do it had failed, because my third party library I'm using in my C#
dll is not signed (so if I choose to sign my project, there is a
compilation error, caused because the 3rd party library is not signed, I
guess).
Please help,
Thanks,
Janiv Ratson.
Kim Greenlee
2006-08-17 19:45:04 UTC
Permalink
Janiv,

Did you check the registry to make sure that the COM interfaces were
actually registered?

Run Regedit.exe and then search on NewSupernaActivation or the name of your
DLL. If you don't find it then it's not registered and that is your problem.
You'll need to run regasm.exe to register the DLL.

Kim
--
digipede - Many legs make light work.
Grid computing for the real world.
http://www.digipede.net
http://krgreenlee.blogspot.net
Janiv Ratson
2006-08-20 08:03:24 UTC
Permalink
Hello all and thanks for your help.
I have registered my dll using regasm.exe.
I can find the NewSupernaActivation in the registry under CLSID.
Still I get Class not registered in my code.
Please help.
Thanks,
Janiv Ratson.
Post by Kim Greenlee
Janiv,
Did you check the registry to make sure that the COM interfaces were
actually registered?
Run Regedit.exe and then search on NewSupernaActivation or the name of your
DLL. If you don't find it then it's not registered and that is your problem.
You'll need to run regasm.exe to register the DLL.
Kim
--
digipede - Many legs make light work.
Grid computing for the real world.
http://www.digipede.net
http://krgreenlee.blogspot.net
Dr. Jochen Manns
2006-08-20 07:33:19 UTC
Permalink
Did you try RegAsm /Codebase.

Eventuall POST the registry Settings under the CLSID here for inspection.
You can check yourself if there are multiple keys below InprocServer32 of
your component. If so remove the CLSID entry of your component, make sure
that the assembly version in AssemblyInfo.cs does not use auto-increment
(1.0.0.1 instead of the VS.NET 2003 default 1.0.*) and RegAsm /Codebase the
assembly again.

Jochen
Post by Janiv Ratson
Hello all and thanks for your help.
I have registered my dll using regasm.exe.
I can find the NewSupernaActivation in the registry under CLSID.
Still I get Class not registered in my code.
Please help.
Thanks,
Janiv Ratson.
Post by Kim Greenlee
Janiv,
Did you check the registry to make sure that the COM interfaces were
actually registered?
Run Regedit.exe and then search on NewSupernaActivation or the name of your
DLL. If you don't find it then it's not registered and that is your problem.
You'll need to run regasm.exe to register the DLL.
Kim
--
digipede - Many legs make light work.
Grid computing for the real world.
http://www.digipede.net
http://krgreenlee.blogspot.net
Janiv Ratson
2006-08-20 09:06:48 UTC
Permalink
Hello Dr. Manns and all,
In order to regasm my dll using /code base, I need my assembly to be signed.
Hoever, my assembly uses 3rd party assembly, which is not signed, and
therefor I my assembly cannot be signed.
Is there any other solution?
Thanks a lot,
Janiv Ratson.
Post by Dr. Jochen Manns
Did you try RegAsm /Codebase.
Eventuall POST the registry Settings under the CLSID here for inspection.
You can check yourself if there are multiple keys below InprocServer32 of
your component. If so remove the CLSID entry of your component, make sure
that the assembly version in AssemblyInfo.cs does not use auto-increment
(1.0.0.1 instead of the VS.NET 2003 default 1.0.*) and RegAsm /Codebase
the assembly again.
Jochen
Post by Janiv Ratson
Hello all and thanks for your help.
I have registered my dll using regasm.exe.
I can find the NewSupernaActivation in the registry under CLSID.
Still I get Class not registered in my code.
Please help.
Thanks,
Janiv Ratson.
Post by Kim Greenlee
Janiv,
Did you check the registry to make sure that the COM interfaces were
actually registered?
Run Regedit.exe and then search on NewSupernaActivation or the name of your
DLL. If you don't find it then it's not registered and that is your problem.
You'll need to run regasm.exe to register the DLL.
Kim
--
digipede - Many legs make light work.
Grid computing for the real world.
http://www.digipede.net
http://krgreenlee.blogspot.net
Dr. Jochen Manns
2006-08-20 08:55:29 UTC
Permalink
Are you sure? I thought that this message is only a warning.

RegAsm : warning RA0000 : Registering an unsigned assembly with /codebase
can ca...
use your assembly to interfere with other applications that may be installed
on
the same computer. The /codebase switch is intended to be used only with
signed
assemblies. Please give your assembly a strong name and re-register it.
Post by Janiv Ratson
Hello Dr. Manns and all,
In order to regasm my dll using /code base, I need my assembly to be signed.
Hoever, my assembly uses 3rd party assembly, which is not signed, and
therefor I my assembly cannot be signed.
Is there any other solution?
Thanks a lot,
Janiv Ratson.
Post by Dr. Jochen Manns
Did you try RegAsm /Codebase.
Eventuall POST the registry Settings under the CLSID here for inspection.
You can check yourself if there are multiple keys below InprocServer32 of
your component. If so remove the CLSID entry of your component, make sure
that the assembly version in AssemblyInfo.cs does not use auto-increment
(1.0.0.1 instead of the VS.NET 2003 default 1.0.*) and RegAsm /Codebase
the assembly again.
Jochen
Post by Janiv Ratson
Hello all and thanks for your help.
I have registered my dll using regasm.exe.
I can find the NewSupernaActivation in the registry under CLSID.
Still I get Class not registered in my code.
Please help.
Thanks,
Janiv Ratson.
Post by Kim Greenlee
Janiv,
Did you check the registry to make sure that the COM interfaces were
actually registered?
Run Regedit.exe and then search on NewSupernaActivation or the name of your
DLL. If you don't find it then it's not registered and that is your problem.
You'll need to run regasm.exe to register the DLL.
Kim
--
digipede - Many legs make light work.
Grid computing for the real world.
http://www.digipede.net
http://krgreenlee.blogspot.net
Janiv Ratson
2006-08-20 12:11:05 UTC
Permalink
Is it a warning we can live with ?
Thanks,
Janiv Ratson.
Post by Dr. Jochen Manns
Are you sure? I thought that this message is only a warning.
RegAsm : warning RA0000 : Registering an unsigned assembly with /codebase
can ca...
use your assembly to interfere with other applications that may be
installed on
the same computer. The /codebase switch is intended to be used only with
signed
assemblies. Please give your assembly a strong name and re-register it.
Post by Janiv Ratson
Hello Dr. Manns and all,
In order to regasm my dll using /code base, I need my assembly to be signed.
Hoever, my assembly uses 3rd party assembly, which is not signed, and
therefor I my assembly cannot be signed.
Is there any other solution?
Thanks a lot,
Janiv Ratson.
Post by Dr. Jochen Manns
Did you try RegAsm /Codebase.
Eventuall POST the registry Settings under the CLSID here for
inspection. You can check yourself if there are multiple keys below
InprocServer32 of your component. If so remove the CLSID entry of your
component, make sure that the assembly version in AssemblyInfo.cs does
not use auto-increment (1.0.0.1 instead of the VS.NET 2003 default
1.0.*) and RegAsm /Codebase the assembly again.
Jochen
Post by Janiv Ratson
Hello all and thanks for your help.
I have registered my dll using regasm.exe.
I can find the NewSupernaActivation in the registry under CLSID.
Still I get Class not registered in my code.
Please help.
Thanks,
Janiv Ratson.
Post by Kim Greenlee
Janiv,
Did you check the registry to make sure that the COM interfaces were
actually registered?
Run Regedit.exe and then search on NewSupernaActivation or the name of your
DLL. If you don't find it then it's not registered and that is your problem.
You'll need to run regasm.exe to register the DLL.
Kim
--
digipede - Many legs make light work.
Grid computing for the real world.
http://www.digipede.net
http://krgreenlee.blogspot.net
Dr. Jochen Manns
2006-08-20 12:02:07 UTC
Permalink
Well - your choice, finally. In this special case: using a strongly names
assembly makes sure that no one tamperes with it. And registering something
as COM open wide access to the component on the system - no way for further
security verifications the assembly will have full trust. Personally (not
more) I can think there are scenarios where you can live with it. Yes,
indeed you losse .NET / CLR security but if someone is able to replace a DLL
on a system in most (s)he can choose to patch the registration to a modified
DLL anyway.

No more help to expect from this side, sorry :-) But actually: does it work
after the RegAsm /Codebase?

Bye

Jochen
Post by Janiv Ratson
Is it a warning we can live with ?
Thanks,
Janiv Ratson.
Post by Dr. Jochen Manns
Are you sure? I thought that this message is only a warning.
RegAsm : warning RA0000 : Registering an unsigned assembly with /codebase
can ca...
use your assembly to interfere with other applications that may be
installed on
the same computer. The /codebase switch is intended to be used only with
signed
assemblies. Please give your assembly a strong name and re-register it.
Post by Janiv Ratson
Hello Dr. Manns and all,
In order to regasm my dll using /code base, I need my assembly to be signed.
Hoever, my assembly uses 3rd party assembly, which is not signed, and
therefor I my assembly cannot be signed.
Is there any other solution?
Thanks a lot,
Janiv Ratson.
Post by Dr. Jochen Manns
Did you try RegAsm /Codebase.
Eventuall POST the registry Settings under the CLSID here for
inspection. You can check yourself if there are multiple keys below
InprocServer32 of your component. If so remove the CLSID entry of your
component, make sure that the assembly version in AssemblyInfo.cs does
not use auto-increment (1.0.0.1 instead of the VS.NET 2003 default
1.0.*) and RegAsm /Codebase the assembly again.
Jochen
Post by Janiv Ratson
Hello all and thanks for your help.
I have registered my dll using regasm.exe.
I can find the NewSupernaActivation in the registry under CLSID.
Still I get Class not registered in my code.
Please help.
Thanks,
Janiv Ratson.
Post by Kim Greenlee
Janiv,
Did you check the registry to make sure that the COM interfaces were
actually registered?
Run Regedit.exe and then search on NewSupernaActivation or the name of your
DLL. If you don't find it then it's not registered and that is your problem.
You'll need to run regasm.exe to register the DLL.
Kim
--
digipede - Many legs make light work.
Grid computing for the real world.
http://www.digipede.net
http://krgreenlee.blogspot.net
Janiv Ratson
2006-08-20 13:27:38 UTC
Permalink
Yes it works.
Thanks,
J.
Post by Dr. Jochen Manns
Well - your choice, finally. In this special case: using a strongly names
assembly makes sure that no one tamperes with it. And registering
something as COM open wide access to the component on the system - no way
for further security verifications the assembly will have full trust.
Personally (not more) I can think there are scenarios where you can live
with it. Yes, indeed you losse .NET / CLR security but if someone is able
to replace a DLL on a system in most (s)he can choose to patch the
registration to a modified DLL anyway.
No more help to expect from this side, sorry :-) But actually: does it
work after the RegAsm /Codebase?
Bye
Jochen
Post by Janiv Ratson
Is it a warning we can live with ?
Thanks,
Janiv Ratson.
Post by Dr. Jochen Manns
Are you sure? I thought that this message is only a warning.
RegAsm : warning RA0000 : Registering an unsigned assembly with
/codebase can ca...
use your assembly to interfere with other applications that may be
installed on
the same computer. The /codebase switch is intended to be used only with
signed
assemblies. Please give your assembly a strong name and re-register it.
Post by Janiv Ratson
Hello Dr. Manns and all,
In order to regasm my dll using /code base, I need my assembly to be signed.
Hoever, my assembly uses 3rd party assembly, which is not signed, and
therefor I my assembly cannot be signed.
Is there any other solution?
Thanks a lot,
Janiv Ratson.
Post by Dr. Jochen Manns
Did you try RegAsm /Codebase.
Eventuall POST the registry Settings under the CLSID here for
inspection. You can check yourself if there are multiple keys below
InprocServer32 of your component. If so remove the CLSID entry of your
component, make sure that the assembly version in AssemblyInfo.cs does
not use auto-increment (1.0.0.1 instead of the VS.NET 2003 default
1.0.*) and RegAsm /Codebase the assembly again.
Jochen
Post by Janiv Ratson
Hello all and thanks for your help.
I have registered my dll using regasm.exe.
I can find the NewSupernaActivation in the registry under CLSID.
Still I get Class not registered in my code.
Please help.
Thanks,
Janiv Ratson.
Post by Kim Greenlee
Janiv,
Did you check the registry to make sure that the COM interfaces were
actually registered?
Run Regedit.exe and then search on NewSupernaActivation or the name of your
DLL. If you don't find it then it's not registered and that is your problem.
You'll need to run regasm.exe to register the DLL.
Kim
--
digipede - Many legs make light work.
Grid computing for the real world.
http://www.digipede.net
http://krgreenlee.blogspot.net
Janiv Ratson
2006-08-20 15:42:12 UTC
Permalink
Hi,
It is now created but could not run due to "Could not load file or assembly
'3rd party assembly' exception.
I guess I haven't completed the action as required.
Any ideas?
Thanks.
J.
Post by Janiv Ratson
Yes it works.
Thanks,
J.
Post by Dr. Jochen Manns
Well - your choice, finally. In this special case: using a strongly names
assembly makes sure that no one tamperes with it. And registering
something as COM open wide access to the component on the system - no way
for further security verifications the assembly will have full trust.
Personally (not more) I can think there are scenarios where you can live
with it. Yes, indeed you losse .NET / CLR security but if someone is able
to replace a DLL on a system in most (s)he can choose to patch the
registration to a modified DLL anyway.
No more help to expect from this side, sorry :-) But actually: does it
work after the RegAsm /Codebase?
Bye
Jochen
Post by Janiv Ratson
Is it a warning we can live with ?
Thanks,
Janiv Ratson.
Post by Dr. Jochen Manns
Are you sure? I thought that this message is only a warning.
RegAsm : warning RA0000 : Registering an unsigned assembly with
/codebase can ca...
use your assembly to interfere with other applications that may be
installed on
the same computer. The /codebase switch is intended to be used only
with signed
assemblies. Please give your assembly a strong name and re-register it.
Post by Janiv Ratson
Hello Dr. Manns and all,
In order to regasm my dll using /code base, I need my assembly to be signed.
Hoever, my assembly uses 3rd party assembly, which is not signed, and
therefor I my assembly cannot be signed.
Is there any other solution?
Thanks a lot,
Janiv Ratson.
Post by Dr. Jochen Manns
Did you try RegAsm /Codebase.
Eventuall POST the registry Settings under the CLSID here for
inspection. You can check yourself if there are multiple keys below
InprocServer32 of your component. If so remove the CLSID entry of
your component, make sure that the assembly version in
AssemblyInfo.cs does not use auto-increment (1.0.0.1 instead of the
VS.NET 2003 default 1.0.*) and RegAsm /Codebase the assembly again.
Jochen
Post by Janiv Ratson
Hello all and thanks for your help.
I have registered my dll using regasm.exe.
I can find the NewSupernaActivation in the registry under CLSID.
Still I get Class not registered in my code.
Please help.
Thanks,
Janiv Ratson.
Post by Kim Greenlee
Janiv,
Did you check the registry to make sure that the COM interfaces were
actually registered?
Run Regedit.exe and then search on NewSupernaActivation or the name of your
DLL. If you don't find it then it's not registered and that is your problem.
You'll need to run regasm.exe to register the DLL.
Kim
--
digipede - Many legs make light work.
Grid computing for the real world.
http://www.digipede.net
http://krgreenlee.blogspot.net
Dr. Jochen Manns
2006-08-20 15:20:37 UTC
Permalink
Hmm, hope that this is not a .NET 2.0 security feature which correlates with
the RegAsm warning.

Check InProgServer32 Codebase and make sure, that all required files are in
this directory. Eventually (?) the assembly requires more legacy (win32)
DLLs in this directory or the system search path.
Post by Janiv Ratson
Hi,
It is now created but could not run due to "Could not load file or
assembly '3rd party assembly' exception.
I guess I haven't completed the action as required.
Any ideas?
Thanks.
J.
Post by Janiv Ratson
Yes it works.
Thanks,
J.
Post by Dr. Jochen Manns
Well - your choice, finally. In this special case: using a strongly
names assembly makes sure that no one tamperes with it. And registering
something as COM open wide access to the component on the system - no
way for further security verifications the assembly will have full
trust. Personally (not more) I can think there are scenarios where you
can live with it. Yes, indeed you losse .NET / CLR security but if
someone is able to replace a DLL on a system in most (s)he can choose to
patch the registration to a modified DLL anyway.
No more help to expect from this side, sorry :-) But actually: does it
work after the RegAsm /Codebase?
Bye
Jochen
Post by Janiv Ratson
Is it a warning we can live with ?
Thanks,
Janiv Ratson.
Post by Dr. Jochen Manns
Are you sure? I thought that this message is only a warning.
RegAsm : warning RA0000 : Registering an unsigned assembly with
/codebase can ca...
use your assembly to interfere with other applications that may be
installed on
the same computer. The /codebase switch is intended to be used only
with signed
assemblies. Please give your assembly a strong name and re-register it.
Post by Janiv Ratson
Hello Dr. Manns and all,
In order to regasm my dll using /code base, I need my assembly to be signed.
Hoever, my assembly uses 3rd party assembly, which is not signed, and
therefor I my assembly cannot be signed.
Is there any other solution?
Thanks a lot,
Janiv Ratson.
Post by Dr. Jochen Manns
Did you try RegAsm /Codebase.
Eventuall POST the registry Settings under the CLSID here for
inspection. You can check yourself if there are multiple keys below
InprocServer32 of your component. If so remove the CLSID entry of
your component, make sure that the assembly version in
AssemblyInfo.cs does not use auto-increment (1.0.0.1 instead of the
VS.NET 2003 default 1.0.*) and RegAsm /Codebase the assembly again.
Jochen
Post by Janiv Ratson
Hello all and thanks for your help.
I have registered my dll using regasm.exe.
I can find the NewSupernaActivation in the registry under CLSID.
Still I get Class not registered in my code.
Please help.
Thanks,
Janiv Ratson.
Post by Kim Greenlee
Janiv,
Did you check the registry to make sure that the COM interfaces were
actually registered?
Run Regedit.exe and then search on NewSupernaActivation or the name of your
DLL. If you don't find it then it's not registered and that is
your problem.
You'll need to run regasm.exe to register the DLL.
Kim
--
digipede - Many legs make light work.
Grid computing for the real world.
http://www.digipede.net
http://krgreenlee.blogspot.net
Janiv Ratson
2006-08-20 16:41:04 UTC
Permalink
How do I use InProgServer32 ?
All required files are in the same folder.
Thanks.
Post by Dr. Jochen Manns
Hmm, hope that this is not a .NET 2.0 security feature which correlates
with the RegAsm warning.
Check InProgServer32 Codebase and make sure, that all required files are
in this directory. Eventually (?) the assembly requires more legacy
(win32) DLLs in this directory or the system search path.
Post by Janiv Ratson
Hi,
It is now created but could not run due to "Could not load file or
assembly '3rd party assembly' exception.
I guess I haven't completed the action as required.
Any ideas?
Thanks.
J.
Post by Janiv Ratson
Yes it works.
Thanks,
J.
Post by Dr. Jochen Manns
Well - your choice, finally. In this special case: using a strongly
names assembly makes sure that no one tamperes with it. And registering
something as COM open wide access to the component on the system - no
way for further security verifications the assembly will have full
trust. Personally (not more) I can think there are scenarios where you
can live with it. Yes, indeed you losse .NET / CLR security but if
someone is able to replace a DLL on a system in most (s)he can choose
to patch the registration to a modified DLL anyway.
No more help to expect from this side, sorry :-) But actually: does it
work after the RegAsm /Codebase?
Bye
Jochen
Post by Janiv Ratson
Is it a warning we can live with ?
Thanks,
Janiv Ratson.
Post by Dr. Jochen Manns
Are you sure? I thought that this message is only a warning.
RegAsm : warning RA0000 : Registering an unsigned assembly with
/codebase can ca...
use your assembly to interfere with other applications that may be
installed on
the same computer. The /codebase switch is intended to be used only
with signed
assemblies. Please give your assembly a strong name and re-register it.
Post by Janiv Ratson
Hello Dr. Manns and all,
In order to regasm my dll using /code base, I need my assembly to be signed.
Hoever, my assembly uses 3rd party assembly, which is not signed,
and therefor I my assembly cannot be signed.
Is there any other solution?
Thanks a lot,
Janiv Ratson.
Post by Dr. Jochen Manns
Did you try RegAsm /Codebase.
Eventuall POST the registry Settings under the CLSID here for
inspection. You can check yourself if there are multiple keys below
InprocServer32 of your component. If so remove the CLSID entry of
your component, make sure that the assembly version in
AssemblyInfo.cs does not use auto-increment (1.0.0.1 instead of the
VS.NET 2003 default 1.0.*) and RegAsm /Codebase the assembly again.
Jochen
Post by Janiv Ratson
Hello all and thanks for your help.
I have registered my dll using regasm.exe.
I can find the NewSupernaActivation in the registry under CLSID.
Still I get Class not registered in my code.
Please help.
Thanks,
Janiv Ratson.
Post by Kim Greenlee
Janiv,
Did you check the registry to make sure that the COM interfaces were
actually registered?
Run Regedit.exe and then search on NewSupernaActivation or the
name of your
DLL. If you don't find it then it's not registered and that is
your problem.
You'll need to run regasm.exe to register the DLL.
Kim
--
digipede - Many legs make light work.
Grid computing for the real world.
http://www.digipede.net
http://krgreenlee.blogspot.net
Dr. Jochen Manns
2006-08-20 16:10:22 UTC
Permalink
Sorry, I ment InprocServer32 in the Registry and there the CodeBase value.

When exactly is the load error reported? If you attach a debugger do you get
any more detailled error (output/trace window or inner exception)? Can you
activate the fusion log to find out which locations have been scanned for
the assembly (debugger should automatically report this - I think).

Jochen
Post by Janiv Ratson
How do I use InProgServer32 ?
All required files are in the same folder.
Thanks.
Post by Dr. Jochen Manns
Hmm, hope that this is not a .NET 2.0 security feature which correlates
with the RegAsm warning.
Check InProgServer32 Codebase and make sure, that all required files are
in this directory. Eventually (?) the assembly requires more legacy
(win32) DLLs in this directory or the system search path.
Post by Janiv Ratson
Hi,
It is now created but could not run due to "Could not load file or
assembly '3rd party assembly' exception.
I guess I haven't completed the action as required.
Any ideas?
Thanks.
J.
Post by Janiv Ratson
Yes it works.
Thanks,
J.
Post by Dr. Jochen Manns
Well - your choice, finally. In this special case: using a strongly
names assembly makes sure that no one tamperes with it. And
registering something as COM open wide access to the component on the
system - no way for further security verifications the assembly will
have full trust. Personally (not more) I can think there are scenarios
where you can live with it. Yes, indeed you losse .NET / CLR security
but if someone is able to replace a DLL on a system in most (s)he can
choose to patch the registration to a modified DLL anyway.
No more help to expect from this side, sorry :-) But actually: does it
work after the RegAsm /Codebase?
Bye
Jochen
Post by Janiv Ratson
Is it a warning we can live with ?
Thanks,
Janiv Ratson.
Post by Dr. Jochen Manns
Are you sure? I thought that this message is only a warning.
RegAsm : warning RA0000 : Registering an unsigned assembly with
/codebase can ca...
use your assembly to interfere with other applications that may be
installed on
the same computer. The /codebase switch is intended to be used only
with signed
assemblies. Please give your assembly a strong name and re-register it.
Post by Janiv Ratson
Hello Dr. Manns and all,
In order to regasm my dll using /code base, I need my assembly to be signed.
Hoever, my assembly uses 3rd party assembly, which is not signed,
and therefor I my assembly cannot be signed.
Is there any other solution?
Thanks a lot,
Janiv Ratson.
Post by Dr. Jochen Manns
Did you try RegAsm /Codebase.
Eventuall POST the registry Settings under the CLSID here for
inspection. You can check yourself if there are multiple keys
below InprocServer32 of your component. If so remove the CLSID
entry of your component, make sure that the assembly version in
AssemblyInfo.cs does not use auto-increment (1.0.0.1 instead of
the VS.NET 2003 default 1.0.*) and RegAsm /Codebase the assembly
again.
Jochen
Post by Janiv Ratson
Hello all and thanks for your help.
I have registered my dll using regasm.exe.
I can find the NewSupernaActivation in the registry under CLSID.
Still I get Class not registered in my code.
Please help.
Thanks,
Janiv Ratson.
Post by Kim Greenlee
Janiv,
Did you check the registry to make sure that the COM interfaces were
actually registered?
Run Regedit.exe and then search on NewSupernaActivation or the
name of your
DLL. If you don't find it then it's not registered and that is
your problem.
You'll need to run regasm.exe to register the DLL.
Kim
--
digipede - Many legs make light work.
Grid computing for the real world.
http://www.digipede.net
http://krgreenlee.blogspot.net
Kim Greenlee
2006-08-21 03:17:01 UTC
Permalink
Janiv,

It sounds like your DLL is registered. The next thing I would look at are
dependencies. You can use Depends.exe usually found as a tool in the
C:\program files\Microsoft Visual Studio 8\Common7\Tools\bin if you are using
VS2005.

Start Depends and then open your DLL, make sure that everything that your
DLL needs to execute is available AND properly registered. If Depends can't
find a dependency it should show up in Red.

Kim
--
digipede - Many legs make light work.
Grid computing for the real world.
http://www.digipede.net
http://krgreenlee.blogspot.net
Dr. Jochen Manns
2006-08-21 05:36:27 UTC
Permalink
But I think this will not show up late binding .NET Interop Dependencies
(DllImportAttribute).
Post by Kim Greenlee
Janiv,
It sounds like your DLL is registered. The next thing I would look at are
dependencies. You can use Depends.exe usually found as a tool in the
C:\program files\Microsoft Visual Studio 8\Common7\Tools\bin if you are using
VS2005.
Start Depends and then open your DLL, make sure that everything that your
DLL needs to execute is available AND properly registered. If Depends can't
find a dependency it should show up in Red.
Kim
--
digipede - Many legs make light work.
Grid computing for the real world.
http://www.digipede.net
http://krgreenlee.blogspot.net
Dr. Jochen Manns
2006-08-17 22:28:20 UTC
Permalink
Did you RegAsm the Assembly? Importing may register only the type library.
Post by Janiv Ratson
Hello,
I have written a C# dll in VS2005.
One interface and class are exported using Interop Services.
I want to use this c# dll in my MFC application, using VS2003.
It compiles after I imported the dll to my MFC app.
On runtime I get class not registered HR error in my MFC project.
_NewActivationPtr myActivation = NULL;
HRESULT hr = myActivation.CreateInstance(__uuidof(NewSupernaActivation));
I don't what to do.
Do I have to use GACUtil to register?
If I want to use GACUtil do I have to sign my project?
Trying do it had failed, because my third party library I'm using in my C#
dll is not signed (so if I choose to sign my project, there is a
compilation error, caused because the 3rd party library is not signed, I
guess).
Please help,
Thanks,
Janiv Ratson.
Continue reading on narkive:
Loading...