Hello World,
I am working on implementing a build for my companies application. The scenario implemeted is producing the error:
‘Class does not support automation or does not support expected interface' when I try to run the RegFree COM interop application from a clients machine.
The application works fine for all development machines when run locally or from the network.
The application is run from the network so - the component is not registered on the clients machine for the running instance. Previous versions of the application would ,however , have been registered on the application using Regasm to register the DLL on the clients machine.
The RegFree COM application works correctly for all development machines but does not work for the customer machine.
<Scenario>
The main application is a VB6 application using interop to reference a VB.NET dll. Some additional interop DLL's are signed and deployed to the GAC. The main application and Dot net DLL runs off the network.
The VB.NET DLL itself is implementing the RegFree COM scenario. This is implemented by:
0.) Regenerating a new signing key for the build.
1.) Building the Dot net DLL with new signing key.
2.) Generating manifest information for the DLL and embedding this into the DLL. The generation and embedding of the manifest information is done with genman32, a utiltiy from Microsoft. The official tool MT does not produce viable results on the development machines as the final build fails to start!.
The commands to generate and embed the manifest information for genman32 are:
genman32 MyDotNet.dll /out:MyDotNet.manifest
genman32 MyDotNet.dll /add /manifest:MyDotNet.manifest
I know that I should really generate and embed the manifest information with MT.exe , but this way never produces a working result on development machines!. So this may be one possible source of the issue!
For reference , the non working MT commands are:
mt.exe -managedassemblyname:MyDotNet.dll -nodependency -out:MyDOTNET.manifest
mt.exe -manifest MyDOTNET.manifest -outputresource:%MyDotNet.dll;#1
....
Moving on, once the DLL manifest information is extrated and embedded with genman32 , I resign the dll with:
sn -Ra MyDotNet.dll MyKey.snk
Now, I generate the type lib information with:
regam /tlb:MyDotNet.tlb MyDotnet.dll
Then, I rebuild the VB6 application with this updated typelib reference MyDotnet.tlb file. Finally, I build the VB6 application manifest which includes the reference for the VB.NET DLL containing the embedded manifest information. This is RegFree COM. The Application manifest looks like:
<assemblyIdentity name="MyDOTNET" version="3.15.0.0" type="win32" processorArchitecture="x86" />
<description>My DOTNET Application</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
name="MyDotNetDLL"
version="3.15.0.0"
publicKeyToken="4b51aafe36029d4a"
processorArchitecture="x86" />
</dependentAssembly>
</dependency>
The reason for the RegFree COM deployment is we need VB6/VB.net Interop-ability. The DotNet/VB application must run from the network, with multiple versions. Therefore application isolation is required to reference the correct DLL found in the current application folder.
Issues:
1.) Generating and embedding the manifest information with MT.exe tool does not produce a workable application after resgining and testing of the VB.NET DLL. The final build error produced when using the MT tool steps is:
"This application failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem"
2.) The described implementation (using the genman32 to generate and embed manifest info) works for all development machines but not business machines. The key difference between machines is installation of the Visual Studio 2005.
This would lead me to believe that the issue is either
1.) With regard to the files (DLL's or configuration Manifests) included in VS2005. The deployment machines only have the Dot Net runtime 2.0.
Or
2.) There is some issue with regard to the MT manifest generation and embed that needs to be addressed before correct working of the Side by Side deployment from the Network .
If there is anybody who could give me information that could help resolve this RegFree COM issue for VB6 /VB.NET interop deployment I would be very appreciative.
OS: Windows XP SP2
Compiler Technologies: VB6 , VB.NET Visual Studio 2005
Best regards,
Brian