Note that there are some explanatory texts on larger screens.

plurals
  1. POOut of Memory error when using vb6 InteropUsercontrol with .Net Framework 4
    text
    copied!<p>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. </p> <p>Here are some more details of how I'm experimenting...</p> <p>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.</p> <p>Here is my application manifest:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt; &lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&gt; &lt;assemblyIdentity type="win32" name="Test" version="1.0.0.0" /&gt; &lt;dependency&gt; &lt;dependentAssembly&gt; &lt;assemblyIdentity type="win32" name="InteropUserControlLibrary1" version="1.0.0.0" /&gt; &lt;/dependentAssembly&gt; &lt;/dependency&gt; &lt;/assembly&gt; </code></pre> <p>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.</p> <p>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.</p> <p>Joel</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload