2015-12-21 393 views
0

我目前正在嘗試使用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到網站上的所有文件。但是,選中「只讀」複選框,當我取消選中並單擊「應用」,然後單擊「確定」時,該框會在打開屬性窗口時重新檢查自身。

有關如何解決此問題的任何想法?

+0

試圖以管理員身份運行VS?試試看,並重新啓動您的電腦 –

+0

據我所知,我正在以管理員身份運行它。如果我不是,有沒有辦法檢查? –

+0

如果VS以用戶身份運行,則標題欄顯示「Microsoft Visual Studio」,如果它以管理員身份運行,則顯示「Microsoft Visual Studio(Administrator)」 –

回答

0

右鍵單擊該文件夾,選擇「屬性」>「安全」,併爲您的所有用戶提供該文件夾的完全權限。您需要以管理員用戶身份登錄。

+0

所有用戶的全部特權?非常安全。這不是必需的,他已經有完全訪問他的用戶,閱讀這個問題。 –

+0

我已經這樣做了。所有用戶都擁有該文件夾的全部權限,並且沒有任何區別。就像我說的,問題似乎是我無法取消選中「只讀」框,該框在關閉屬性窗口後重置,即使點擊「應用」然後「確定」。 –

相關問題