NHibernate的在IIS 7,SQLClientPermissionException [英] nHibernate on IIS 7, SQLClientPermissionException

查看:98
本文介绍了NHibernate的在IIS 7,SQLClientPermissionException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发使用NHibernate MVC应用程序;通过VS内置的应用程序运行没有错误的Web服务器上运行。当安装程序并通过IIS7本地主机上运行的应用程序中调用System.Data.SqlClient.PermissionDemand后抛出的SqlClientPermission异常(SqlClient中调用这个内部)

I am developing an MVC application using nHibernate; running through VS's built in web server the application runs without errors. When setup and running through IIS7 on localhost, the application throws a SQlClientPermission exception after calling System.Data.SqlClient.PermissionDemand (SqlClient calls this internally)

我已经启用了应用程序在完全信任的运行,但它似乎并不影响结果。

I have enabled the application to run under full trust but it doesn't seem to affect the outcome.

推荐答案

从描述,我猜你在连接字符串中使用集成安全性。也许下面沿着线的东西。

From the description, I'm guessing that you're using Integrated Security in your connection string. Maybe something along the lines below.

Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;

当通过VS运行内置的Web服务器,它运行在您的凭据,这就是为什么它的工作原理。

When running through VS built in web server, it runs under your credentials and that's why it works.

要得到这个在IIS上工作,无论是

To get this to work on IIS, either


  1. 创建运行在新的IIS应用程序池
    根据您的凭据

  2. 或者,使用SQL验证。

(让我知道如果你喜欢我,进一步扩大)

(Let me know if you like me to expand further)

这篇关于NHibernate的在IIS 7,SQLClientPermissionException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆