Use Assemblies in Silverlight?


  •  Hello,

     I started to port my game engine over to silverlight last week and I stumbled upon a lot of missing features. One of the most frustrating is the Assembly support. My engine heavily relies on the use of Assemblies having my own xml format for game objects, states and screens.

    Now I was able to easily miss all that for the game objects but the unfortunately its a whole different story for the GameStates and GameScreens.

     In the xml the class name is defined which is then used to instantiate using the right Assembly.

    Important: This code is executed within the game engine assembly.

     AppDomain MyDomain = AppDomain.CurrentDomain;
    Assembly[] AssembliesLoaded = MyDomain.GetAssemblies();
    _runtimeAssemblies = AssembliesLoaded;  

    This however does not work.
    I tried replacing this with:

     Assembly[] AssembliesLoaded = {Assembly.GetExecutingAssembly(), Assembly.GetEntryAssembly()};

    GetExecutingAssembly would be the GameEngine assembly which is executing.

    GetEntryAssembly should be the game assembly.. but also this function does not work.

     Who can help me out with this? I was also thinking about changing my game xml format over to Xaml but I see a lot of work in that.

    I was also looking into Assembly.LoadFrom but I have no clue how to get my files ( I want all dll's and exe's from the current directory Directory.GetCurrentDirectory() which doesn't work either )


    Thanks in advance,


    Wednesday, April 14, 2010 1:09 PM