Hi,
I have created one com component using .Net framework 1.1 which i am calling in VB application. It is working fine. Now I installed framework 2.0. When I am trying to call this COM component using .Net application it is working fine.
But when I am trying to call this COM comp. using my VB application it is now working. It is throwing exception. Root of problem which i think is when I am calling this COM comp. using VB, Framwork 2.0 is getting loaded. I tried option like adding configuration file in application. But nothing is working out.
Can anybody help me out how can i load my COM comp. in framework 1.1..
Thanks in advance,
Harry

Side by side execution +COM components
A.I.V
Hi,
I did some test: I have created a C# in VS2003, and registered it as COM component, then I created a VB6 application (proect1.exe) that invokes the component.
Then I created a config file in the same folder as proect1.exe by the name Project1.exe.config and content:
<
configuration><startup>
<requiredRuntime version="v1.1.4322" safemode="true"/>
</startup>
</configuration>
What I see is that whenever this file is present framework v1.1.4322 gets loaded, if I delete it then I see that framework v2.0.50727 gets loaded (I walidated it with process explorer from sysinternals.com)
That is the best I can think of. If this is not working probably the problem is not runtime versions but something else.
Max
Zesovich
Hi Max,
Thanks for replying..
I tried what you suggested, but still my poblem is not solved.
One thing i want to mention is that the output of my Project is class Library. If it would have been Windows application then i would i have got the myapp.exe.config file for the App.config file which i have added, but for COM comoponents we dont get config files like myapp.exe.config. The config file will have the same name which we will give them, but for EXE's they will be created like myapp.exe.config.
I have gone through some links where it is mentioned like we can redirect the assembly for specified version using <bindingRedirect> but how can i use this to redirect my assembly to target only framwork 1.1...
ref: http://msdn2.microsoft.com/en-us/library/eftw1fys(VS.80).aspx
Can you suggest me something which can be workout...
Harish.
Khin
Hi,
I don't have an answer but I have a similar issue. I have a c-sharp dll that is called from a VB6 DLL. This was working fine before framework 2.0 was installed. Here is the error.
Error Number -2146233079
Error Desc. Automation error
I have tried all suggests found on a variety of web forms. No luck the only solution is to uninstall 2.0 which is not going to work for us. We are heading into the future to use SQL 2005 which needs 2.0 framework. Our development environments will not be functional because of this. Now I'm sure your asking why can't just re-write the VB6 components Well it's not cost effective. We have 60 VB6 dll's that all call this c-sharp dll. Note this will work from a c-sharp exe application and it work without any issues prior to the install of 2.0
Thanks in Advance
Jerry.
sjw7
Drop me a letter on the mail that you may see in my profile, and I will send you both projects.
Max
Tony Lambert
Hi,
Thanks for you interest and reply...
can you tell me how you are invoking the COM component through your VB 6 code.
I also want to know what is your project output type.
I did one small R&D where I build one Class Assembly with output as a Class Library. This is not a Component.
The class Code is:
Imports
SystemPublic
Class AxClass123 Public Function DateTest() As String Return Date.Parse("01-01-10/10/2001").ToString 'This is not supported by 2.0 End Function Public Function FrameVersion() As StringReturn Environment.Version.Major & "." & Environment.Version.Minor & "." & Environment.Version.Build
End Function
End Class
And I created DLL for the same and registered this into GAC
Then in vb application when i used instance of this dll :
Private Sub Command1_Click()
On Error GoTo err
Dim a As Object
Set a = CreateObject("ComTest.AxClass123")
MsgBox a.FrameVersion
MsgBox a.datetest
err:
MsgBox err.Description
End Sub
Then in the output I got version as 2.0.40607
But when the same code written in VB.Net the output was 1.1.4322
I will give you the VB.Net code also
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try Dim a As Objecta = CreateObject("ComTest.AxClass123")
MsgBox(a.FrameVersion)
MsgBox(a.datetest)
Catch ex As Exception End Try End SubWhen I was surfing I got some informatio from MS site that :COM applications hosted by an extensible host, such as Microsoft Internet Explorer or Microsoft Office cannot control which version of the runtime is loaded.
So whether VB 6 is also an extensible host or what.
If that is the case the one solution remains that is to load the CLR in the same AppDomain in which my Component will be called..
Regards,
Harish
yuryk
Hi,
I think that you should create a config file for your main application with the name like this: myapp.exe.config and content like following:
<configuration>
<startup>
<supportedRuntime version="v1.1.4322"/>
<requiredRuntime version="v1.1.4322"/>
</startup>
</configuration>
Max