Search code examples
c#.net.net-coreorleans

AppDomainSetup could not be found


Fiddling around Microsoft Orleans. This is the silo I've written from the tutorial, I get wierd error the "AppDomainSetup couldn't be found" although I can see it in the docs under System.

Searching google leads to nowhere...

class Program
{

    static SiloHost siloHost;

    static void Main(string[] args)
    {
        AppDomain hostDomain = AppDomain.CreateDomain("OrleansHost", null,
            new AppDomainSetup()
            {
                AppDomainInitializer = InitSilo
            });

        DoSomeClientWork();

        Console.WriteLine("Orleans Silo is running.\nPress Enter to terminate...");
        Console.ReadLine();

        hostDomain.DoCallBack(ShutdownSilo);

    }

}

Solution

  • AppDomainSetup is not listed in the official .NET Core 2.0 API docs: https://learn.microsoft.com/en-us/dotnet/api/?term=AppDomainSetup&view=netcore-2.0

    Where do you see it? Could you be looking at .NET Framework docs by any chance?

    Also, please note that even though AppDomain.CreateDomain is part of .NET Standard API, it will throw PlatformNotSupporteException on many implementations, such as .NET Core. AppDomain is not really a cross-platform concept. Parts of it are implemented and supported but the concept of separate application domains is not cross platform and not supported in .NET Core/.NET Standard.