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.
When running through VS built in web server, it runs under your credentials and that’s why it works.
To get this to work on IIS, either
under your credentials
(Let me know if you like me to expand further)