问题
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