automations and the application domain
xo
Member Posts: 34
I'm having a slight problem with a .Net COM interop automation. In one of the .Net classes there is a static variable and it appears that even though the codeunit that references the automation is calling clearall as the last action, upon the next invocation of the codeunit the .Net application domain is the same -- at least the static variable has accumulated more state so it doesn't start from a clean slate. I'm not too happy about this persistent application domain. Any hints?
0
Comments
-
Have you looked into how the garbage collection works in .Net. I'm not super .Net savvy, but from my understanding when an object goes out of scope it's free for the garbage collector to dispose of, but there is no guarantee on when those values are flushed.
Could you add a function to reset or clear your objects state.0 -
Have you tried to use the second parameter of the Create function? (NewServer parameter)0
-
I don't think it's the GC - it would be remarkable if it were so slow to flush the objects - besides, I'm expecting the entire application domain to perish and therefore the static state of my class to perish as well.
I think kine has a point - I need to look at the create function. :-)0 -
I have the same problem I think. .NET garbage collection doesn't seem to work from NAV.

We have made a component for socket communication, which also kept living no matter how many times we tried to clear it. Once wrapped in C++ it worked like a charm...Regards
Peter0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
