RegSvcs Error System.ArgumentOUtOfRangeException with VB6 interfac

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I'm running into a odd situation trying to run RegSvcs on a C# library that
is implementing ComponentServices and an interface that is exposed by a VB6
library.

Steps to reproduce the error:

Create a VB6 dll that has a publicly exposed interface.
Create a strong named Primary interop assembly for the VB6 library.
Create an Enterprise Service that inherits from ComponentServices and the
VB6 exposed interface though your PIA.
Compile the library and run RegSvcs on it.

I receive the following error:

The following installation error occurred:
1: An unknown error occurred while configuring components.
2: Exception of type System.ArgumentOutOfRangeException was thrown.
Parameter name: slot

If you comment out the VB6 exposed interface the error goes away and the
object installs properly into the COM+ catalog.

If you try dragging the compiled dll with the VB6 interface directly into
the Components folder in ComponentServices you get this error in the event
log:

Installation of '[path to dll]' into '[guid of application]' failed with an
exception:

System.EnterpriseServices.RegistrationException: An unknown error occurred
while configuring components. ---> System.ArgumentOutOfRangeException:
Exception of type System.ArgumentOutOfRangeException was thrown.
Parameter name: slot
at System.Runtime.InteropServices.Marshal.GetMethodInfoForComSlot(Type t,
Int32 slot, ComMemberType& memberType)
at
System.EnterpriseServices.MethodConfigCallback.FindObject(ICatalogCollection
coll, Object key)
at
System.EnterpriseServices.RegistrationDriver.ConfigureCollection(ICatalogCollection coll, IConfigCallback cb)
at
System.EnterpriseServices.InterfaceConfigCallback.ConfigureSubCollections(ICatalogCollection coll)
at
System.EnterpriseServices.RegistrationDriver.ConfigureCollection(ICatalogCollection coll, IConfigCallback cb)
at
System.EnterpriseServices.ComponentConfigCallback.ConfigureSubCollections(ICatalogCollection coll)
at
System.EnterpriseServices.RegistrationDriver.ConfigureCollection(ICatalogCollection coll, IConfigCallback cb)
at
System.EnterpriseServices.RegistrationDriver.ConfigureComponents(ApplicationSpec spec)
--- End of inner exception stack trace ---

Server stack trace:
at
System.EnterpriseServices.RegistrationDriver.ConfigureComponents(ApplicationSpec spec)
at
System.EnterpriseServices.RegistrationDriver.InstallAssembly(RegistrationConfig regConfig, Object obSync)
at
System.EnterpriseServices.RegistrationHelperTx.InstallAssemblyFromConfig(RegistrationConfig& regConfig, Object sync)
at System.Runtime.Remoting.Messaging.Message.Dispatch(Object target,
Boolean fExecuteInContext)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
at
System.EnterpriseServices.RegistrationHelperTx.InstallAssemblyFromConfig(RegistrationConfig& regConfig, Object sync)
at
System.EnterpriseServices.RegistrationHelper.TryTransactedInstall(RegistrationConfig regConfig)
at
System.EnterpriseServices.RegistrationHelper.InstallAssemblyFromConfig(RegistrationConfig& regConfig)
at System.EnterpriseServices.RegistrationHelper.InstallAssembly(String
assembly, String& application, String partition, String& tlb,
InstallationFlags installFlags)
at
System.EnterpriseServices.Internal.ComManagedImportUtil.InstallAssembly(String asmpath, String parname, String appname).

I found someone who ran into this problem through google groups and he
posted that he found a resolution but failed to post the solution.

What is trying to be done is to have an existing VB6 infrastructure that
supports the interface be able to talk to a .NET component through
ComponentServices and the known VB6 interface. Any help you can provide is
great.

Thanks for your Time.

Ikatsu
.



Relevant Pages

  • Re: Question re Migration of VB6 App to .NET
    ... I've had the opportunity to advise folks on how to move VB6 to .Net in the ... Create an ENTIRELY NEW USER INTERFACE. ... business object layer was actually designed to be independent of the U/I ... Pick a relatively self-contained set of business objects. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Question re Migration of VB6 App to .NET
    ... I've had the opportunity to advise folks on how to move VB6 to .Net in the ... Create an ENTIRELY NEW USER INTERFACE. ... business object layer was actually designed to be independent of the U/I ... Pick a relatively self-contained set of business objects. ...
    (microsoft.public.dotnet.general)
  • Re: Question re Migration of VB6 App to .NET
    ... I've had the opportunity to advise folks on how to move VB6 to .Net in the ... Create an ENTIRELY NEW USER INTERFACE. ... business object layer was actually designed to be independent of the U/I ... Pick a relatively self-contained set of business objects. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: How to marshal code to the original thread
    ... I didn't spend time on the code you posted, I just included here a complete sample (CS and a VB6 code) to illustrate how I think you could implement your wrapper and to prove you can fire events from abitrary CLR threads to VB6 COM clients using connectionpoint interfaces. ... // pay attention to the class decoration, this is important for connectionpoint interface support. ... Private Sub myCowboy_Touched ... | Willy Denoyette wrote: ...
    (microsoft.public.dotnet.languages.csharp)