# .Net Wrapper Error

**URL:** <https://techcommunity.softwareag.com/t/net-wrapper-error/95444>\
**Category:** Forum\
**Tags:** Mainframe-Integration, EntireX\
**Created:** [November 24, 2010, 1:04pm UTC](https://techcommunity.softwareag.com/t/net-wrapper-error/95444 "2010-11-24T13:04:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![YUBEN1](https://avatars.discourse-cdn.com/v4/letter/y/eada6e/32.png) [@YUBEN1](https://techcommunity.softwareag.com/u/YUBEN1)\
**Post date:** [November 24, 2010, 1:04pm UTC](https://techcommunity.softwareag.com/t/net-wrapper-error/95444/1 "2010-11-24T13:04:37Z")

</div>

I recently upgraded from EntireX v7.2.1 to v8.1.2.0. I have a .Net program that uses the .Net wrapper to make a call to a service hosted on a Mainframe (z/OS) environment. The program makes several calls to a Mainframe program that accepts a single string parameter. Prior to the upgrade everything worked. However, since the upgrade, I am getting this error:

> [@](#):
>
> One of the background threads threw exception:  
> System.Runtime.InteropServices.COMException (0x80070006): The handle is invalid. (Exception from HRESULT: 0x80070006 (E\_HANDLE))  
> at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)  
> at System.Runtime.InteropServices.Marshal.FreeHGlobal(IntPtr hglobal)  
> at SoftwareAG.EntireX.NETWrapper.Runtime.CALL\_INFORMATION\_BLOCK.Finalize()

This error occurs spuriously i.e. at different points. The .Net program calls the EntireX stub repeatedly but fails after several calls. I have attached the stub log for reference.

---

<div class="post-metadata">

**Author:** ![Rolf\_Bahlke](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/rolf_bahlke/32/109_2.png) [@Rolf\_Bahlke](https://techcommunity.softwareag.com/u/Rolf_Bahlke)\
**Post date:** [November 24, 2010, 4:58pm UTC](https://techcommunity.softwareag.com/t/net-wrapper-error/95444/2 "2010-11-24T16:58:56Z")

</div>

The stub log does not contain an error. I have deleted the stub log because it seems to contain confidential data.

I suggest that you contact support to get this issue resolved.

---

<div class="post-metadata">

**Author:** ![YUBEN1](https://avatars.discourse-cdn.com/v4/letter/y/eada6e/32.png) [@YUBEN1](https://techcommunity.softwareag.com/u/YUBEN1)\
**Post date:** [March 15, 2011, 8:46pm UTC](https://techcommunity.softwareag.com/t/net-wrapper-error/95444/3 "2011-03-15T20:46:54Z")

</div>

The error was being caused by trying to use the .Net wrapper from a .Net Framework version 4 project. When the project was compiled against .Net Framework version 2, there was no problem.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:59pm UTC](https://techcommunity.softwareag.com/t/net-wrapper-error/95444/4 "2021-04-02T14:59:25Z")

</div>


