MarshalByRefType is not defined RRS feed

  • Question

  • User2098947605 posted

    I wasn't really sure where to post this...

    I'm working with the AppDomain class, and I'm trying to get this sample VB code (http://msdn.microsoft.com/en-us/library/system.appdomain(VS.80).aspx ) to work but I'm getting the error in the subject line.  Also when I search for MarshalByRefType in Object Browser I get no results.  The article says the reference namespace is System.  Is this a type o, or did the name of the class change?

    Thanks, Alex

    Thursday, May 8, 2008 7:08 PM

All replies

  • User-525215917 posted
    Make sure you have reference to System namespace in your application.
    Friday, May 9, 2008 5:02 AM
  • User2098947605 posted

    Thanks, but System is always referenced automatically. 

    Friday, May 9, 2008 11:49 AM
  • User-525215917 posted
    There are some project templates that come with empty references. I tried on one such template and I had to add reference to System to find this class. That's why I suggested to check out if you have reference in place.
    Saturday, May 10, 2008 6:26 AM
  • User-974017120 posted

    There is no MarshalByRefType in System.  (And I'm guessing you've already got a reference to System in your project)

    Anyway, If you're talking about the MSDN sample code for AppDomain, the "MarshalByRefType" is defined at the bottom of the code snippet.  Not obvious at first, I know!  Plus, it sounds like something you'd find in some .NET class, but it isnt.  In your code you'd replace it with the class of yours that you want to load and unload.  just change your class to inherit from MarshalByRefObject, then you can use the code.


    Monday, July 14, 2008 9:02 AM