Using with VB6 COM when Only 4.0 framework installed

Advertisement

chrislong2
Joined:
Posts:
19
Location:
USA

Using with VB6 COM when Only 4.0 framework installed

Hi,

I've got the library working great from VB6, however the library is requiring the 2.0 framework. I understand it was built against the 2.0 framework, but the installation instructions seem to suggest it will work on the 4.0 framework as well. No go. I even tried making a WinSCPnet.config file such as the following:

<?xml version ="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
<supportedRuntime version="v2.0.50727" />
</startup>
<runtime>
<generatePublisherEvidence enabled="false"/>
</runtime>
</configuration>


[The runtime section at the end is to solve another problem - that the 2.0 framework automatically phones an OCSP server to check the digital certificate revocation status when the library is loaded - which unacceptably flags my app in third-party firewalls as sending data]

If I register it using the 4.0 RegAsm.exe, it still requires the 2.0 framework to be installed. I've spent hours and hours on this. How can I get the library to run if EITHER the 2.0 OR the 4.0 framework is installed?

This is important since the 2.0 framework is NOT installed by default on Win8/8.1/10 but 4.0 is.

Reply with quote

Advertisement

chrislong2
Joined:
Posts:
19
Location:
USA

Re: Using with VB6 COM when Only 4.0 framework installed

Well, I managed to get it to work but boy is this silly. Basically I needed to add the .config file mentioned above for my VB6 app (not the DLL). I had actually already tried this, but previously messed up and created it as myapp.config instead of myapp.exe.config. By creating the latter, I solved this and it does now seem to run regardless of framework version installed. I know config files aren't so unusual in the .NET world, but for my VB6 app, it seems rather silly that I've got to install this .net related config file for MY APP just so that the library that my app happens to use for one of its many functions can work on either 2.0 or 4.0 CLR.

Reply with quote

Advertisement

You can post new topics in this forum