Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

unrelased resource in page add-in

(0) ShareShare
ReportReport
Posted on by 309

In a page add-in I declare and instantiate a class (bptiProxy) from a dll.

========================================================

BptiProxyClient bptiProxy;

.

.

.

if (bptiProxy == null)

 {

     bptiProxy = new BptiProxyClient();

 }

========================================================

This causes the error "Exception has been thrown by the target of an invocation" when the page is opened a second time, unless I restart the RTC in between.

The add-in class implements Idisposible and contains method dispose like this:

========================================================

       protected override void Dispose(bool disposing)

       {

           base.Dispose(disposing);

           if (disposing)

           {

               bptiProxy.Dispose();

           }

       }

========================================================

It seems like bptiProxy is not fully released until RTC is closed.

How can I solve this?

Best Regards / HÃ¥kan Svensson

*This post is locked for comments

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans