- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我一直在 visual studio 中使用我的网站 (ASP.NET MVC),但现在我想将它托管在我的服务器上。我从 visual studio 发布到要使用的网络共享上。服务器正在运行 Windows Home Server、IIS 6 和 SQL Server 2008 R2 (express)。
在 Microsoft SQL Server Management Studio 中,我附加了数据库并确保用户 IUSR_SERVER 是数据库的所有者。我还确保用户网络服务具有访问权限。
该网站在 IIS 中配置为以 IUSR_SERVER 匿名运行。我已授予对 IUSR_SERVER 以及文件系统中的网络服务的写入和读取访问权限,并确保没有任何内容是只读的。
web.config 有这个连接字符串:
<connectionStrings>
<remove name="ApplicationServices" />
<add name="ApplicationServices" connectionString="Data Source=.\SQLExpress;Integrated Security=True;Initial Catalog=MyDatebase"
providerName="System.Data.SqlClient" />
</connectionStrings>
但是,我无法浏览我的网站。我只得到这个错误:
Server Error in '/' Application.
User does not have permission to perform this action. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: User does not have permission to perform this action.
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) +4846887 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
感觉我什么都试过了。非常感谢您在这方面的帮助。
编辑:
This is the event in the event viewer:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 2010-06-05 23:55:08
Event time (UTC): 2010-06-05 21:55:08
Event ID: 88a3a76c00a34e21bf6e711b3b3a8f21
Event sequence: 137
Event occurrence: 59
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/6893/Root-2-129202466028125000
Trust level: Full
Application Virtual Path: /
Application Path: C:\Inetpub\WebPage\
Machine name: SERVER
Process information:
Process ID: 5864
Process name: w3wp.exe
Account name: SERVER\USER
Exception information:
Exception type: SqlException
Exception message: User does not have permission to perform this action.
Request information:
Request URL: http://localhost/
Request path: /
User host address: 127.0.0.1
User:
Is authenticated: False
Authentication Type:
Thread account name: SERVER\USER
Thread information:
Thread ID: 1
Thread account name: SERVER\USER
Is impersonating: True
Stack trace: at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user)
at System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe()
at System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode()
at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
at System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
Custom event details:
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
最佳答案
原来问题是我的 DataContext 使用它自己的连接字符串,它不在 web.config 中。因此,它从未更改,无法建立连接。我更改了我的代码,以便我的数据上下文使用来自 web.config 的字符串并且它有效:)
关于c# - 异常 : User does not have permission to perform this action,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2953137/
我从 ssh 收到以下错误: Permissions 0777 for '/Users/username/.ssh/id_rsa' are too open. It is recommended th
我正在使用 WSL1(Windows Linux 子系统)和 Ubuntu 20.04.1 LTS 开发 Win10。我有一个 Samba (1.0) 网络共享,我想通过我的 Ubuntu 终端在上面
文件权限 我有一个文件 data.tgz我想解压缩。 -rw-r--r-- 1 username group 20342951248 mai 18 11:50 data.tgz 目录权限 文件所在的目
我正在尝试设置一些其他组不应该看到的组维护文件夹。目前,我通过取消单击@@sharing 选项卡中的“从更高级别继承权限”复选框来实现这一点,但我想自动执行此操作。 我在文档或谷歌搜索中找不到任何关于
在 Android 4 下,以下简单的 native C 代码行失败并出现 Permission denied 错误 when not run as 根: online_socket = socket
(我是 tortoise SVN 的新手) 我的乌龟 SVN 中有 2 个文件夹。每个人都需要一组不同的授权(我不想有权访问第一个文件夹的人对第二个文件夹具有读/写访问权限。 我怎样才能完成它?我注意
我用 tar -zxvf tarFile.tar.gz解压tarFile,但有错误提示tar: subfile :Cannot open: Permission denied . 我是root用户,权
我是 WAMP 的新手我今天刚刚安装了它。 设置进行得很顺利,本地主机似乎可以工作,但是当我尝试访问 phpMyAdmin 时我收到此错误: Forbidden You don't have perm
我想做的是从文件夹内的文件夹中获取 .mp3 文件。多次。 一切都很完美,除了当我尝试将文件复制到新文件夹(已经存在)时,它给出:[Errno 13]权限被拒绝: import os, shutil
我是 WAMP 的新手我今天刚刚安装了它。 设置进行得很顺利,本地主机似乎可以工作,但是当我尝试访问 phpMyAdmin 时我收到此错误: Forbidden You don't have perm
我正在开发一个应用程序,我在其中使用塔位置跟踪位置。所以我使用地理定位 api 来跟踪位置并访问手机状态以获取网络详细信息。 这很好用,突然间它开始给出 LOCATION_HARDWARE 权限的安全
这两种语法有什么区别。android:uses-permission 和 uses-permission。例如: 当我创建一个从存储中读取的 Activity 时,Android Studio 自
我正在尝试使用新的 GrantPermissionRule这是最新支持库的一部分。 在我的 list 中,我声明如下: 在我的代码中,我调用: @Rule public GrantPermissio
有没有navigator.permissions.query 的替代方案 Permissions API 查询以检查 geolocation 权限。导致它仍处于工作草案中并且浏览器兼容性较差。 W3C
这个错误真的真的很奇怪,我不知道如何重现它以及如何修复它,因为我进行了大量搜索,但没有任何用处。 这是堆栈跟踪: Stack Trace _______________________________
我正在尝试在 ubuntu 16.4 上安装 MaryTTS。 但是当我上线时 sudo -u mary git clone https://github.com/marytts/marytts.gi
在我们基于 Symfony2 的应用程序中,我们希望创建一个列表,列出系统中哪些用户对给定域对象具有权限。我们正在使用 ACL,我们的直接直觉是查看从相关域对象的 ACLProvider 返回的 AC
我今天收到这封邮件,但我没有使用 Admob 广告,而是使用 applovin 和 Facebook,我必须添加此权限还是仅适用于他们使用 Admob 的开发者? 即使没有像我一样的admob,每个人
我有一个 Jenkins 用户,我想授予其对 Jenkins 实例运行远程 CLI 的权限。第一个命令是获取 config.xml: java -jar jenkins-cli.jar -s http
我今天收到这封邮件,但我没有使用 Admob 广告,而是使用 applovin 和 Facebook,我必须添加此权限还是仅适用于他们使用 Admob 的开发者? 即使没有像我一样的admob,每个人
我是一名优秀的程序员,十分优秀!