Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.TypeLoadException when generating migration in UWP app #3803

Closed
dontjee opened this issue Nov 19, 2015 · 4 comments
Closed

System.TypeLoadException when generating migration in UWP app #3803

dontjee opened this issue Nov 19, 2015 · 4 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@dontjee
Copy link

dontjee commented Nov 19, 2015

I'm generating a migration in my existing UWP app and I get a TypeLoad exception.

I have the following nuget packages installed for SQLite

"EntityFramework.Commands": "7.0.0-rc1-final",
"EntityFramework.SQLite": "7.0.0-rc1-final",

The full text of the error is

System.TypeLoadException: Could not find Windows Runtime type 'Microsoft.Graphics.Canvas.UI.Xaml.CanvasAnimatedControl'. ---> System.NotSupportedException: Types from custom Windows Runtime components are not supported in desktop applications.
   --- End of inner exception stack trace ---
   at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
   at System.Signature..ctor(IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
   at System.Reflection.RuntimeConstructorInfo.GetParametersNoCopy()
   at System.Reflection.RuntimeConstructorInfo.GetParameters()
   at System.SharedTypeExtensions.<>c.<GetConstructibleTypes>b__19_1(ConstructorInfo c)
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at System.SharedTypeExtensions.<>c.<GetConstructibleTypes>b__19_0(TypeInfo t)
   at System.Linq.Enumerable.<>c__DisplayClass6_0`1.<CombinePredicates>b__0(TSource x)
   at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext()
   at Microsoft.Data.Entity.Design.DbContextOperations.FindContextTypes()
   at Microsoft.Data.Entity.Design.DbContextOperations.FindContextType(String name)
   at Microsoft.Data.Entity.Design.DbContextOperations.CreateContext(String contextType)
   at Microsoft.Data.Entity.Design.MigrationsOperations.AddMigration(String name, String outputDir, String contextType)
   at Microsoft.Data.Entity.Design.OperationExecutor.<AddMigrationImpl>d__7.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 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)
Could not find Windows Runtime type 'Microsoft.Graphics.Canvas.UI.Xaml.CanvasAnimatedControl'.

If it helps, the CanvasAnimatedControl comes from the Win2D nuget package and is not local to the project.

@rowanmiller
Copy link
Contributor

@dontjee can you share a project that reproduces this? We should be resilient to having references to Win RT stuff.

@dontjee
Copy link
Author

dontjee commented Nov 20, 2015

@rowanmiller Yup, this project reproduces it - https://www.dropbox.com/s/9olnjse1nvrbejp/EfReproApp.zip?dl=0

The error came up when I created a class that took ICanvasAnimatedControl or CanvasAnimatedControl in the constructor.

@rowanmiller
Copy link
Contributor

Thanks, we'll get someone to look at it

@rowanmiller rowanmiller added this to the 7.0.0 milestone Nov 20, 2015
@rowanmiller rowanmiller modified the milestones: 7.0.0-rc2, 7.0.0 Dec 7, 2015
@bricelam
Copy link
Contributor

I suspect this is caused by calling GetParameters on the constructor.

#3752 also requires avoiding this line of code.

@bricelam bricelam modified the milestones: 7.0.0-rc2, 7.0.0 Dec 14, 2015
@ajcvickers ajcvickers removed this from the 1.0.0-rc2 milestone Oct 15, 2022
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Oct 15, 2022
@ajcvickers ajcvickers added this to the 1.0.0 milestone Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

4 participants