[英]EF6 add migration fails - Access to the path 'C\WINDOWS\SYSTEM32\MyContext.edmx' is denied
I've added new DbSet to my context and tried to run Add-Migration, but it fails with weird error: 我已经将新的DbSet添加到我的上下文中,并尝试运行Add-Migration,但是它失败并出现奇怪的错误:
Access to the path 'C:\\WINDOWS\\System32\\MyContext.edmx' is denied.
拒绝访问路径“ C:\\ WINDOWS \\ System32 \\ MyContext.edmx”。
Of course, the file does not exist in that directory. 当然,该目录中不存在该文件。 What can cause this problem?
什么会导致此问题?
This is not my first migration, but I have no idea what caused the path to change or how to revert it to previous value. 这不是我的第一次迁移,但是我不知道是什么原因导致路径更改或如何将其还原为以前的值。
So, I restarted the whole computer- didn't help. 因此,我重新启动了整个计算机,但没有帮助。
But, inspired by @Pac0 comment, I used Nuget Package Manager to update one of the packages hoping it would fix the base path. 但是,受@ Pac0注释的启发,我使用了Nuget软件包管理器来更新其中一个软件包,希望它可以修复基本路径。 Also, that particular project runs in admin mode, so I started VS in admin mode also.
另外,该特定项目以admin模式运行,因此我也以admin模式启动了VS。
After that, the path is correct and the tool works. 在那之后,路径是正确的并且该工具可以工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.