我目前正在尝试使用Windows 8和Visual Studio 2015社区的电子商务网站制作管理页面,该社区应允许管理员更新/更改项目在网站上。Visual Studio中的项目文件夹 - 只读,不能写入
当我尝试到现场我得到以下错误的编辑项:
"Access to the path 'C:\Users..(Web site path)..\Secure' is denied."
下面的描述是错误给出:
"ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via
<identity impersonate="true"/>
, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.To grant ASP.NET access to a file, right-click the file in File Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access."
堆栈跟踪错误:
[UnauthorizedAccessException: Access to the path 'C:\Users\..(Web Site Path)..\Secure' is denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +419
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +886
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +144
System.IO.FileStream..ctor(String path, FileMode mode) +91
System.Web.HttpPostedFile.SaveAs(String filename) +100
Secure_Admin.btnImgUpdate_Click(Object sender, EventArgs e) +149
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +138
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +150
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6023
我检查了项目文件夹中的安全部分,并且我有完整的acces s到网站上的所有文件。但是,选中“只读”复选框,当我取消选中并单击“应用”,然后单击“确定”时,该框会在打开属性窗口时重新检查自身。
有关如何解决此问题的任何想法?
试图以管理员身份运行VS?试试看,并重新启动您的电脑 –
据我所知,我正在以管理员身份运行它。如果我不是,有没有办法检查? –
如果VS以用户身份运行,则标题栏显示“Microsoft Visual Studio”,如果它以管理员身份运行,则显示“Microsoft Visual Studio(Administrator)” –