尝试打开或创建物理文件时,CREATE FILE遇到操作系统错误5(访问被拒绝.) [英] CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file

查看:1644
本文介绍了尝试打开或创建物理文件时,CREATE FILE遇到操作系统错误5(访问被拒绝.)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以自学模式从Java迁移的网络(已安装Visual Studio 2019社区和SqlServer 2017 64位社区版). 我正在按照本教程链接

net migrating from java in selfstudy mode.(visual studio 2019 community & SqlServer 2017 64bit community edition installed). I was following the instructions on this tutorial link

当我执行初始迁移步骤时,运行更新数据库时遇到此错误,我遇到了此错误.我知道它与数据库访问/配置问题有关,我非常感谢将其提供给Package Manager Console的正确方法.

When I executed the step of initial migration step I encountered this error when i run update-database I'm encountering this error. I know its related to database access/ configuration problem I'd really appreciate the correct way to provide it to Package Manager Console.

我在SQL Server服务中添加了允许服务与桌面权限进行交互.以及经历了nuget软件包管理器设置(包括SQL Server工具)的设置,我没有找到要添加测试连接的任何设置.

I've added the allow service to interact with desktop permission in the service of SQL server. As well as went through the settings of nuget Package manager settings including SQL server tools where I didnt find any setting to add of test connection.

尝试打开或创建物理文件>'C:\ Users \ userRazorPagesMovieContext-f0053713-d1d4-4b1b-b07a-> c77d6dfaf131.mdf'时,CREATE FILE遇到操作系统错误5(访问被拒绝.). 创建数据库失败.列出的某些文件名无法创建.检查>相关错误.

CREATE FILE encountered operating system error 5(Access is denied.) while >attempting to open or create the physical file >'C:\Users\userRazorPagesMovieContext-f0053713-d1d4-4b1b-b07a->c77d6dfaf131.mdf'. CREATE DATABASE failed. Some file names listed could not be created. Check >related errors.

推荐答案

我得到了解决方案谢谢@Oscar的解决方案.这是由于Visual Studio将所有项目存储在C驱动器和文件夹中的默认行为而引起的问题.最佳解决方案将项目文件存储在操作系统以外的其他驱动器中.

I got the solution Thank you @Oscar for the solution. This is the problem originated due to visual studio's default behavior of storing the all projects in C drive and folders. Best solution Store the project files in other drives other than the OS.

临时解决方案:只需右键单击->属性->安全授予写权限

Temporary solution: just rightclick -> property -> security give write permission

update:它说问题出在Sql server 2017中的一个错误中,该错误已在update中修复

update: its said that the problem arises with a bug in Sql server 2017 which is fixed in update

SQL Server 2017的累积更新6.

Cumulative Update 6 for SQL Server 2017.

@主持人请将这个问题标记为已结束,谢谢.

@moderators plz mark this question as closed, thank you.

这篇关于尝试打开或创建物理文件时,CREATE FILE遇到操作系统错误5(访问被拒绝.)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆