gpt4 book ai didi

asp.net - 如何在 IIS 7 中设置对 App_data 的写权限?

转载 作者:行者123 更新时间:2023-12-05 05:28:59 24 4
gpt4 key购买 nike

我需要设置一个站点以使用本地 IIS 7 服务器(运行 Windows 7)。我收到一个权限错误,指出我应该在 App_Data 文件夹上设置写入权限。

我在哪里做这个?我是通过 IIS 7 管理还是 Windows 资源管理器来执行此操作?

我用于默认 asp.net 网站项目的 url:

http://localhost:10000/Account/Register.aspx?ReturnUrl=

Server Error in '/' Application.

用户没有执行此操作的权限。说明:在执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。

异常详细信息:System.Data.SqlClient.SqlException:用户无权执行此操作。

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): User does not have permission to perform this action.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +6277312
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +412
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1363
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +53
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +6292062
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +6291977
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +352
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +506
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +49
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +6293782
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +78
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +1922
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +89
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +6296606
System.Data.SqlClient.SqlConnection.Open() +300
System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +150
System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +4603263
System.Web.Security.SqlMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) +2858
System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +412
System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) +226
System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +586
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +52
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3691

最佳答案

IIS 7.5+ (Windows Server 2008) 的另一个可能的答案是允许组“IIS_IUSRS”写入。我相信该组甚至包含 IIS 8+ AppPool 用户,因此它是确保对 App_Data 的写入访问权限的更持久的方法

C:\inetpub\wwwroot> icacls App_Data /grant IIS_IUSRS:M
processed file: App_Data
Successfully processed 1 files; Failed processing 0 files

C:\inetpub\wwwroot>

关于asp.net - 如何在 IIS 7 中设置对 App_data 的写权限?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5158114/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com