简体   繁体   English

EF6添加迁移失败-拒绝访问路径'C \\ WINDOWS \\ SYSTEM32 \\ MyContext.edmx'

[英]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.

相关问题 拒绝访问路径“ C:\\ Windows \\ System32 \\” - Access to the path 'C:\Windows\System32\ is denied 访问路径 'c:\windows\system32\inetsrv\config\' 被拒绝 - Access to the path 'c:\windows\system32\inetsrv\config\' is denied C#错误Windows启动时,对路径'C:\\ Windows \\ system32 \\ Com \\ dmp'的访问被拒绝 - C# Error Access to the path 'C:\Windows\system32\Com\dmp' is denied When Windows Startup WebClient下载-“拒绝访问路径'c:\\\\ windows \\\\ system32 \\\\ inetsrv \\\\ MyPrintManager.exe'” - WebClient Download - “Access to the path 'c:\\windows\\system32\\inetsrv\\MyPrintManager.exe' is denied” GoogleWebAuthorizationBroker-拒绝访问路径'C:\\ Windows \\ system32 \\ config \\ systemprofile' - GoogleWebAuthorizationBroker - Access to the path 'C:\Windows\system32\config\systemprofile' is denied “访问路径'D:\\\\ Windows \\\\ system32 \\\\文件被拒绝”Azure Web App - “Access to the path 'D:\\Windows\\system32\\file is denied” Azure Web App EF6添加迁移失败 - EF6 add-migration fails EF6迁移失败 - EF6 Migration fails .NET CORE 3 Windows 服务的基本路径返回 C:\Windows\System32,但实际文件夹为 D:\MyCustomService - .NET CORE 3 The base path of a Windows Service is returning C:\Windows\System32, But actual folder is D:\MyCustomService 如何在 C# 中获取 Windows\system32\config\systemprofile\AppData\Local\ 文件夹路径? - How to get Windows\system32\config\systemprofile\AppData\Local\ folder path in C#?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM