I've been using the vb6 Interop Toolkit to allow me to use vb.Net usercontrols in a legacy vb6 application. I want to start using some features in .Net 4, but when I change the target framework on the .Net usercontrol project from ".Net Framework 2" to ".Net Framework 4", it builds ok, and runs ok on my development box, but when I deploy the app to a test box, the app fails upon startup with a "Out of Memory" error.
Here are some more details of how I'm experimenting...
Using VS 2010 with the Interop 2.1 Toolkit installed, I create a "VB6 Interop Usercontrol" project. I add a button to the default InteropUsercontrol.vb class (just so the control will be visible in the host app). I build the dll. I create a vb6 project (Project1) and reference the "InteropUsercontrolLibrary1" component from the vb6 Projects/Components/Controls dialog. I add the control to the form and compile Project1.exe. I then deploy Project1.exe, InteropUsercontrolLibrary1.dll, and Project1.exe.manifest (see below) to test machines (XP and Windows7) that have Framework 4.0 installed. With only these three files, the app runs fine. If I repeat the same process but change the target framework to 4.0, I get the Out of Memory error.
Here is my application manifest:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
type="win32"
name="Test"
version="1.0.0.0"
/>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="InteropUserControlLibrary1"
version="1.0.0.0"
/>
</dependentAssembly>
</dependency>
</assembly>
The component manifest is automatically build by the Interop Toolkit pre-build events and embedded in the dll. It works with 2.0 so I expect it to with 4.0 also.
No matter what I do, I can't make a usercontrol written in .net 4.0 run in a vb6 application. Any suggestions would be appreciated.
Joel