I've too problems with a remoting component COM exposed. Works sucessfully
.NET called, but COM invocation raises -2146233077 (8013150b) error .
I have debuged remarking parts of the remoting component code, and the error
raise when I try to register the chanel with
RemotingConfiguracion.Configure.
Well I have found the answers to my problem and it was actually 2 problems I
found out.
1.) If you have multiple versions of the framework installed this will cause
a problem if you are using an older version with COM. When your .net
component is registered for COM interop the library that is actually being
loaded by the system is mscoree.dll which launches the newest version of the
CLR. If you want to specify a version and or to prohibit your component from
loading if that version does not exist you need an app.config file for your
vb6 app. app.configs are only for .net apps but since we are loading the CLR
it will be looking for one anyway. Name the file App.exe.config, and replace
App with your applications name. Here are the contents of that file.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<requiredRuntime version="v1.1.4322"/>
<supportedRuntime version="v1.1.4322" />
</startup>
</configuration>
This doesnt help for debugging because it seems that vb6 compiles on the fly
or in memory so no exe is generated. So to fix this for development I suggest
removing non supported framework versions from your machine.
2.) My other problem is that whenever I debugged the app and stopped
debugging, then started a second time I got an exception from the remoting
services stating that the client name was already in use. The client name is
specified in your conf file you load through remotingconfiguration.configure.
What i found to be the problem is that in vb6 while you debug the app runs
under the same process ID as the IDE, so when you stop debugging for some
reason I believe the CLR is still running with this configure info still
loaded. My fix for it was to check remotingconfiguration.applicationNam for a
value and if null then to load the configure method.
regards,
Josh
> I've too problems with a remoting component COM exposed. Works sucessfully
> ..NET called, but COM invocation raises -2146233077 (8013150b) error .
[quoted text clipped - 27 lines]
> >
> > Thanks, Josh
Scott - 24 May 2006 14:34 GMT
> This doesnt help for debugging because it seems that vb6 compiles on the
> fly
> or in memory so no exe is generated. So to fix this for development I
> suggest
> removing non supported framework versions from your machine.
When debugging with multiple versions of the framework on your machine, you
can create an app.config file for VB6. Call it vb6.exe.config and put it in
the VB6 directory. This should allow you to specify which version of the
framework will be loaded up.
Josh Bernard - 24 May 2006 14:43 GMT
haha that makes sense, I dont know why I wasnt thinking of that for debugging!
thanks
> > This doesnt help for debugging because it seems that vb6 compiles on the
> > fly
[quoted text clipped - 6 lines]
> the VB6 directory. This should allow you to specify which version of the
> framework will be loaded up.
jgochin - 28 May 2006 08:30 GMT
Scott,
Thanks for the tip, I was having a similar problem with a .NET CCW and VB6.
I knew the problem was that the app.config elements required by my component
weren't being loaded. It was a very difficult problem to debug due to the
lack of debugger information. Finally I read this thread and it clued me into
the problem; the placement and the name of the app.config.
From what I can infer from the, "vb6.exe.config answer" is that the
app.config required for the CCW needs to be in the same directory as the
executable that instanciates it, and have the same name as the executable
with ".config" appended to it. And the executable does not have to be .NET.
My problem was that my .NET test application wasn't exhibiting the same
problem because it had an app.config.
Well it’s working now.
Oh, and for what its worth, I too was trying to use remoting as well, except
I was working the Windows Communication Framework.
Thanks Again!
Jeff Gochin
MCP, MCAD