locked
Can't use winrt mef RRS feed

  • Question

  • I'm using the code from the documentation but I'm getting an error.

    code used in a new windows store app project:
    ----------------------------------------------------
            protected override async void OnLaunched(LaunchActivatedEventArgs args)
            {
                var configuration = new ContainerConfiguration().WithAssembly(typeof(App).Assembly);
    ..
    --------------------------------------------------------

    error i get:
    --------------------------
    Error    1    'System.Type' does not contain a definition for 'Assembly' and no extension method 'Assembly' accepting a first argument of type 'System.Type' could be found (are you missing a using directive or an assembly reference?)
    ---------------------------

    The problem is with the 'Assembly' type. I can make it work if i add this code in a .net class library project but not with a windows store app.

    I have installed this package with package manager:
    <package id="Microsoft.Composition" version="1.0.16" targetFramework="win" />
    Thursday, November 22, 2012 4:05 PM