我正在使用SQL Server(MSSQLBlogProvider)在主网站下的虚拟目录中安装应用程序(BlogEngine)。 BlogEngine拥有自己的数据库。
一切正常,这意味着我从SQL数据库获得了默认页面。
然后我使用ASP.net网站管理工具\ Security来创建用户(如本视频http://www.nyveldt.com/misc/BE13SQLMembership.html所示,大约在7分钟左右。很好地解释了,如果他正在做什么,这很简单快速你点击视频的时间轴)
执行这些步骤后,我收到错误:
对象'aspnet_Roles_RoleExists',数据库'Blog',架构'dbo'上的EXECUTE权限被拒绝。我可以使用访问规则,但没有成功。
请注意,我使用的是“集成安全性”。
我看起来并不完全正确,在哪里进行修改。任何帮助都是值得欣赏的。
堆栈追踪:
[SqlException (0x80131904): The EXECUTE permission was denied on the object 'aspnet_Roles_RoleExists', database 'Blog', schema 'dbo'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +388
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +688
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4403
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +6665097
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite) +6667096
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +577
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +735
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +290
System.Web.Security.SqlRoleProvider.RoleExists(String roleName) +967
System.Web.Security.Roles.RoleExists(String roleName) +336
BlogEngine.Core.Right.InitRightForBlogInstance() in j:\Projects\BlogEngine_2_7_0_0\blogengine_4f5eed923a57\BlogEngine\BlogEngine.Core\Security\Right.cs:612
BlogEngine.Core.Right.get_RightsByRole() in j:\Projects\BlogEngine_2_7_0_0\blogengine_4f5eed923a57\BlogEngine\BlogEngine.Core\Security\Right.cs:600
BlogEngine.Core.Right.EnsureBlogInstanceDataLoaded() in j:\Projects\BlogEngine_2_7_0_0\blogengine_4f5eed923a57\BlogEngine\BlogEngine.Core\Security\Right.cs:566
BlogEngine.Core.Right..cctor() in j:\Projects\BlogEngine_2_7_0_0\blogengine_4f5eed923a57\BlogEngine\BlogEngine.Core\Security\Right.cs:113
[TypeInitializationException: The type initializer for 'BlogEngine.Core.Right' threw an exception.]
BlogEngine.Core.Right..ctor() in j:\Projects\BlogEngine_2_7_0_0\blogengine_4f5eed923a57\BlogEngine\BlogEngine.Core\Security\Right.cs:539
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +159
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +256
System.Activator.CreateInstance(Type type, Boolean nonPublic) +127
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +14376269
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +200
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +28
System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +83
System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +335
System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1262
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +133
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12881540
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12722601
答案 0 :(得分:2)
开放互联网信息服务经理
检查IIS网站正在使用的应用程序池
转到应用程序池
查看您的应用程序池在
打开SQL Server Management Studio
连接到SQL Server实例
为您的数据库打开一个新查询
运行此SCRIPT:
GRANT SELECT,EXECUTE,UPDATE,INSERT ON SCHEMA :: dbo to
[NT AUTHORITY \ NETWORK SERVICE]
*将[NT AUTHORITY \ NETWORK SERVICE]替换为您的应用程序池正在运行的任何标识。
返回IIS管理器
回收您的应用程序池
浏览到您的网站