MarshalByRefType is not defined

Last post 07-14-2008 9:02 AM by Vandalfoe. 4 replies.

Sort Posts:

  • MarshalByRefType is not defined

    05-08-2008, 7:08 PM
    • Loading...
    • AlexB1318
    • Joined on 09-08-2004, 7:12 PM
    • Posts 405

    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

  • Re: MarshalByRefType is not defined

    05-09-2008, 5:02 AM
    • Loading...
    • DigiMortal
    • Joined on 01-10-2007, 7:22 PM
    • Tallinn, Estonia
    • Posts 468
    Make sure you have reference to System namespace in your application.
    Don't forget to mark solution providing post as "Answered".
    It helps others to find correct solutions!

    Also visit my ASP.NET blog!
  • Re: MarshalByRefType is not defined

    05-09-2008, 11:49 AM
    • Loading...
    • AlexB1318
    • Joined on 09-08-2004, 7:12 PM
    • Posts 405

    Thanks, but System is always referenced automatically. 

  • Re: MarshalByRefType is not defined

    05-10-2008, 6:26 AM
    • Loading...
    • DigiMortal
    • Joined on 01-10-2007, 7:22 PM
    • Tallinn, Estonia
    • Posts 468
    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.
    Don't forget to mark solution providing post as "Answered".
    It helps others to find correct solutions!

    Also visit my ASP.NET blog!
  • Re: MarshalByRefType is not defined

    07-14-2008, 9:02 AM
    • Loading...
    • Vandalfoe
    • Joined on 07-14-2008, 8:55 AM
    • Posts 1

    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.

     

Page 1 of 1 (5 items)
Microsoft Communities
Page view counter