InvalidOperationException “get_MetadataToken() cannot be used on the current platform” when creating tables

删除回忆录丶 提交于 2019-12-04 23:29:53

问题


This is an interesting problem for me. On my work machine, my code works perfectly fine, but on my home machine when starting with a new sqlite file I get an InvalidOperationException when db.Database.Migrate() is called.

According to Windows Update, both machines are up to date.

Visual Studio 2015 also shows as up to date on both machines.

I'm running EF7 rc1-final

The stacktrace isn't exactly deep:

   System.InvalidOperationException occurred
  HResult=-2146233079
  Message=The API 'System.Reflection.MemberInfo.get_MetadataToken()' cannot be used on the current platform. See http://go.microsoft.com/fwlink/?LinkId=248273 for more information.
  Source=mscorlib
  StackTrace:
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
  InnerException: 

The provided link just goes to the MSDN main page. I'd personally prefer a 404.

There's Issue 190, but I don't see why it would only be a problem on one of my machines.

Is there a solution/workaround?

来源:https://stackoverflow.com/questions/37061249/invalidoperationexception-get-metadatatoken-cannot-be-used-on-the-current-pla

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!