Asked by:
Exiting a 16-bit application that uses .NET

Question
-
Hi,
Our company still has to support legacy products written in 16-bit (MSVC 1.52). We "thunk" from 16 to 32-bit very often without any issue.
Recently, I have felt the need to use the nice features/classes offered by .NET and so I would load and unload (via LoadLibrary and FreeLibrary) a VC++ CLR enabled dll that will make use of .NET classes . All works nice except when I exit my 16-bit application "hosted" under ntvdm, the 32-bit CLR dll that made use of .NET seemingly stays in memory and I cannot rename the folder from which my 16-bit app was running from as a result.
The function FreeLibrary does return true and no matter how simplistic my usage of .NET classes may be, I cannot get it to release my folder. If I choose to make my 16-bit app to run in a separate memory space (shortcut option) then I am able to rename my folder but I want to know if there is a different solution than this workaround.
Thanks.
All replies
-
Stop Win16. It is deprecated.
We are in post 32bit era, we are in the Win64 world/
So migrate your Win16 app to Win32.
regards,
Christophe PICHAUD
MCSD, MCSD.NET, MCTS NET 2.0
Christophe Pichaud -
-
-
It's a wild guess, but have you tried rebuilding your dll in .Net 4?
.Net versions before 4 are "sticky" in that once a process loads them, they can't really be unloaded. That's one of the reasons why the Microsoft MSI group did not recommend creating custom actions in .Net.
-