VS.NET Add-In AppDomain Problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Andy Maggs (andy65_at_community.nospam)
Date: 03/09/05

  • Next message: Sergey M: "Re: VS.NET Add-In AppDomain Problem"
    Date: Wed, 9 Mar 2005 17:22:29 -0000
    
    

    Hi,

    We have an add-in that has been developed in 1.0 managed code (C# + VB.NET)
    to review the source code currently loaded into the IDE for coding standards
    compliance. We have implemented a solution whereby the user is able to
    write VB.NET script that interacts with an object model that we provide in
    order that they can define their own standards. This script is compiled
    into an in-memory assembly at review time. To reduce the work that was
    required to develop the language source code parsers we opted for a solution
    that extracted some information from the compiled assemblies which are
    loaded by reflection. Because of the inability to unload assemblies from an
    AppDomain, we have had to develop a solution that compiles, loads and
    reviews source code in a secondary AppDomain so that the whole AppDomain can
    then be unloaded when the review completes thus releasing the memory used
    and any file system locks. However, and here is the problem, when the
    secondary AppDomain is released, the whole of the Visual Studio.NET 2002
    process is unloaded immediately without any exceptions, errors or warnings
    of any kind. We thought we had found a solution by calling the
    AppDomain.Unload method from a timer elapsed event handler 10 seconds after
    the review had finished and although VS.NET did not unload, all was not well
    because if we then attempted to perform a second review the whole VS.NET
    process unloaded again shortly after the secondary AppDomain was created.
    We experience the same problem when performing a review with the same add-in
    in VS.NET 2003.

    I have searched extensively using Google and cannot find anyone else
    mentioning this problem, so my question is: Is this a known issue with
    AppDomains in VS.NET 2002/2003 and if so is there a work-around? All
    assistance gratefully received.

    I posted to both the extensibility and remoting groups because the problem
    involves both areas and experts in either may be able to help.

    Kind Regards

    Andy Maggs
    Visible Progress Technologies Limited
    Empowering software developers in the pursuit of software excellence through
    the provision of process automation and productivity tools.
    http://www.visibleprogress.com


  • Next message: Sergey M: "Re: VS.NET Add-In AppDomain Problem"

    Relevant Pages

    • Re: VS.NET Add-In AppDomain Problem
      ... that the review is run is OK and the form displays fine, however, in the ... > VB.NET) to review the source code currently loaded into the IDE for coding ... Because of the inability to unload ... > the problem, when the secondary AppDomain is released, the whole of the ...
      (microsoft.public.dotnet.framework.remoting)
    • Re: New version of Truecrypt released (6.1a)
      ... ..thus failing nemo_outis's requirement of "source code that is known ... to have had a thorough review by competent people." ... Truecrypt's source code not having had thorough competent ... independent review. ...
      (alt.privacy)
    • Re: Rules for constructors
      ... Normally I review code made by a group of developers ... of TeX and we have a Pascal compiler that does not recognize ... the Gosling-Emacs editor as our normal environment. ... to review/analize/change source code programs made by other people... ...
      (comp.lang.java.programmer)
    • Re: Source code auditing
      ... I think OWASP Code Review book is a good starting point for source code ... for complete list of OWASP books: ... Information Assurance Certification Review Board ...
      (Pen-Test)
    • Re: [Patch 10/18] fs/logfs/inode.c
      ...  Maybe I should wait a bit before resending? ... found in the review. ... Linux is more the core point of a concept that surrounds "open source" ... people actually want to look at source code. ...
      (Linux-Kernel)