Forum Discussion
Principal.WindowsImpersonationContext on .Net 6 and EF6
We are currently migrating our projects which are developed on .NET472 to .NET6.0. We had EF6 used for Oracle DB connection and it has been done via Oracle.Manageddataaccess. Now after we changed the underlying projects, we are getting below error. We found there were two feasible solutions on net but we had some issue.
Change from Oracle.ManagedDataAccess to Oracle.ManagedDataAccess.Core(this needs application to be moved EFCore). But we cant do this since we cant move all our code from EF6 to EFCore now.
Add reference to Microsoft.NETCore.Portable.Compatibility, i have added that but still we are getting same error.
System.TypeLoadException: 'Could not load type 'System.Security.Principal.WindowsImpersonationContext' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.'
Here are the reference link which i have already tried https://stackoverflow.com/questions/68593542/could-not-load-type-system-security-principal-windowsimpersonationcontext-from
https://stackoverflow.com/questions/37468552/you-must-add-a-reference-to-assembly-mscorlib-version-4-0-0
1 Reply
- LanHuangFormer Employee
Hi Sundaram_R,
Thanks for posting your issue here.
However this platform is used for how-to discussions and sharing best practices for building any app with .NET. Since your issue is a technical question, welcome to post it in Microsoft Q&A forum, the support team and communities on Microsoft Q&A will help you for any technical questions.
Besides, it will be appreciated if you can share it here once you post this technical question Microsoft Q&A.
Best Regards,
Lan Huang