Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / September 2003

Tip: Looking for answers? Try searching our database.

Error 429 Active X Componnent Can't Create Object Deployment Build

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Barry Young - 05 Sep 2003 20:28 GMT
I created a Deployment Solution for my COM object using VS.NET.

When I install the object on another machine and set a reference to the
object, I can see all properties, events, etc.

When I run the application, when it goes to instantiate the COM object I get
an Error 429 Active X Component Can't Create Object..

Am I missing something in my deployment?  Is it not placing the object in
the GAC or something?

I have the .NET Framework ver 1.1 installed on the target machine.

During the deployment build I get this warning...

This setup does not contain the .NET Framework which must be installed on
the target machine by running dotnetfx.exe before this setup will install.
You can find dotnetfx.exe on the Visual Studio .NET 'Windows Components
Update' media. Dotnetfx.exe can be redistributed with your setup.

But the .NET Framwork already exists on the target machine..

Any Ideas?

Barry
Phil Wilson - 06 Sep 2003 00:36 GMT
The assembly doesn't have to be in the GAC, but you do need to install it on the
target system doing the equivalent of what regasm [/codebase] would do, which
includes creating HKCR entries that point to mscoree.dll and information about
the assembly version, sn, codebase etc.
Signature

Phil Wilson [MVP Windows Installer]
----

> I created a Deployment Solution for my COM object using VS.NET.
>
[quoted text clipped - 21 lines]
>
> Barry
Barry Young - 06 Sep 2003 01:05 GMT
Hey Phil,

Thanks for the reply...

I kind of see where you are going, but creating a Deployment and
building the install, isn't the install supposed to take care of
everything to get the COM object working properly on the target
machine??

The whole purpose of building a deployment for the COM object is so
everything will be included, installed, and referenced / registered
properly...

Am I not correct in this assumption??

Take care!

Barry
Phil Wilson - 06 Sep 2003 17:20 GMT
I'm assuming that the COM object you built is an assembly that offers COM
interfaces. The deployment project doesn't know that your assembly is also a
COM server, and with VS.NET or 2003 there's no way to tell it (its
registration options are for DllRegisterServer COM servers, not .NET COM
servers) and you need to do what regasm would do. The base registry entries
can be seen by running regasm with the /regfile option, and import that .reg
file to the setup project, and you may need to generate a type library and
register that too.

I did an article here http://www.wd-mag.com/wdm/articles/2002/0209/

Download the code for that (Code Archive) and there's a Visual Studio setup
project that may help. The commercial setup tools (InstallShield Developer)
do all this stuff with a single check box, but VS setups just do basic
things.
Signature

Phil Wilson [MVP Windows Installer]

> Hey Phil,
>
[quoted text clipped - 14 lines]
>
> Barry
Barry Young - 06 Sep 2003 17:45 GMT
Phill,

Thanks for the help..

I click on the link, and the article doesn't contain a HREF link -- just
text.  So how do I get to your article?

I'll try your suggestions and let you know how it goes..

Barry
Barry Young - 08 Sep 2003 15:07 GMT
Phil,

I have created the .reg file with regasm.exe.  Do I just simply add the
file .reg to my setup project?  I assume everytime I recompile the COM
Object source, I need to redo the .reg file?  So this will always be a
seperate step??

Also what about the /codebase step?  Do I need to do this as well?  

What steps do I need to do to finish the installation so it works
properly on the target machine?

Thanks for all your help!  I really appreciate it!

Barry
Barry Young - 08 Sep 2003 20:00 GMT
Hey Phil,

Well here is what I did:

(1) Created a Deployment.
(2) Installed it on the Target Machine.
(3) On the Target Machine, I did the following:
   (A) regasm mydll.dll
   (B) regasm /codebase mydll.dll

Now what I don't understand is why the Deployment project doesn't do the
registration of the DLL???

Anyway, I guess I am good for now..

Take care!

Barry
Phil Wilson - 08 Sep 2003 22:07 GMT
It's just not something that VS deployment projects do, it's by design. The
fully-featured tools do it (InstallShield, Wise etc).

To get this in your setup project, if you have run regasm with /codebase with
the regfile option, you can import that .reg file into VS setups by
right-clicking on the "Registry on Target Machine" text. The important thing to
fix is that the InprocServer32 key should point to [SystemFolder]mscoree.dll
(complete with those brackets and case).

If you have a type library that needs registering, add the .tlb to your setup
and it will automatically set the Register property to vsdrfCOM and register all
the interfaces.
Signature

Phil Wilson [MVP Windows Installer]
----

> Hey Phil,
>
[quoted text clipped - 14 lines]
>
> Barry
Barry Young - 08 Sep 2003 22:32 GMT
Hey Phil,

I am totally following you now.. Thanks!

I imported the .reg and it created all the registry entries for the
target machine...  AWESOME...

But I am not quite sure about this next part...

The important thing to fix is that the InprocServer32 key should point
to [SystemFolder]mscoree.dll (complete with those brackets and case).

Is this a manual step on the target machine or is this done via the
setup project?

Sorry for the ignorance...

Thanks again for your help...

Barry
Phil Wilson - 10 Sep 2003 18:31 GMT
Do that in the setup project. [SystemFolder] is a Windows Installer property
that will be resolved at install time to the actual folder path.
Signature

Phil Wilson [MVP Windows Installer]
----

>
> Hey Phil,
[quoted text clipped - 17 lines]
>
> Barry
Phil Wilson - 17 Sep 2003 23:08 GMT
Duh, I'm being dumb here - for the class library you can set the Register
property to vsdraCOM and it will create the registration entries we've been
talking about. Sorry to drag you down the long path.
Signature

Phil Wilson [MVP Windows Installer]
----

>
> Hey Phil,
[quoted text clipped - 17 lines]
>
> Barry
Barry Young - 08 Sep 2003 22:48 GMT
Hey Phill,

Is there a way for the install to automatically detect and re-register
the DLL on the target machine if it exists already?

Similiar to when you Build the COM Object with VS.NET on the development
machine, it unregisters and registers the new version.

Or I assume I will have to uninstall and re-install??

Probably the safest route??

Thanks again!

Barry
Phil Wilson - 10 Sep 2003 18:37 GMT
Nothing automatic in that area. The best thing to do in your .NET class is to
nail down the Guids for the class (and the interface if you used one) so that
the Guids don't change - use GuidAttribute. Also nail down the version with
AssemblyVersion (don't use the *) otherwise that changing version will cause
your assembly to be not found. Interfaces work well too. Once mscoree.dll gets
the COM client's request, it looks for the assembly in the normal way, requiring
version, strong name etc to match.
Signature

Phil Wilson [MVP Windows Installer]
----

>
> Hey Phill,
[quoted text clipped - 12 lines]
>
> Barry
Richard Brown - 06 Sep 2003 00:37 GMT
Guessing here, buy may point you in the right direction.

RE: Can't create component: Not sure of this, but don't you also have to
distribute the OCX that the Ax wrapper is wrapped around?

RE: dotfx: No idea, but isn't that just a warning saying the 'if the target
machine doesn't have it, it needs to be installed'.  Installshield has an
option to include the runtime or not, probably the same idea.

> I created a Deployment Solution for my COM object using VS.NET.
>
[quoted text clipped - 21 lines]
>
> Barry

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.