efcore: Cannot generate migration in UWP when using Win2D

I have a UWP project that uses Win2D. When I attempt to generate a migration with EF the migration will fail with the following error.

System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) at System.Reflection.RuntimeAssembly.get_DefinedTypes() at Microsoft.Data.Entity.Design.Internal.StartupInvoker…ctor(String startupAssemblyName, String environment) at Microsoft.Data.Entity.Design.DbContextOperations…ctor(ILoggerProvider loggerProvider, String assemblyName, String startupAssemblyName, String environment) at Microsoft.Data.Entity.Design.MigrationsOperations…ctor(ILoggerProvider loggerProvider, String assemblyName, String startupAssemblyName, String environment, String projectDir, String rootNamespace) at Microsoft.Data.Entity.Design.OperationExecutor.<>c__DisplayClass3_0.<.ctor>b__3() at Microsoft.Data.Entity.Internal.LazyRef1.get_Value() at Microsoft.Data.Entity.Design.OperationExecutor.<AddMigrationImpl>d__7.MoveNext() at System.Linq.Buffer1…ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source) at Microsoft.Data.Entity.Design.OperationExecutor.OperationBase.<>c__DisplayClass4_0`1.<Execute>b__0() at Microsoft.Data.Entity.Design.OperationExecutor.OperationBase.Execute(Action action) Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

This is due to the use of CanvasBitmap.LoadAsync() from Win2D. Any use of that method will prevent migrations from being generated. I have created a sample project demoing this. You can find it here

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

@darenm yep the packages won’t even install on UWP at the moment. Unfortunately, even when things start working, I think you are going to have to wait for an update to UWP tooling before you can use them.

I have verified this issue still exists with RC2. I have updated my original sample to RC2 binaries https://github.com/geoffmmorgan/MigrationTest/tree/master