Security issue with NHibernate in a deployed web application

I deployed a web application using NHibernate to the server. The application compiles and runs on my local machine, but there is a problem with NHibernate on the new server. I get the following error:

Description: An attempt by the application to perform an operation that is not permitted by a security policy. To provide this application, permission is required, contact your administrator system or change the level of application trust in the configuration file.

Exception Details: System.Security.SecurityException: A permission request of type "System.Configuration.ConfigurationPermission, System.Configuration, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = tokenkeyhere" failed.

It is proposed to change the "level of trust" of the application in the configuration file. How exactly am I doing this? This is the first time I have deployed the NHibernate web application, so I find it difficult.

+3
source share
1 answer

We have been looking at this a lot lately. Here is a link to run NHibernate in the trust tool

This is the shortest explanation I've seen at various levels of trust: Demystified Levels of Trust

From the article:

- Full trust – your code can do anything that the account running it can do.
- High trust – same as above except your code cannot call into unmanaged code. i.e. Win32 APIs, COM interop.
- Medium trust – same as above except your code cannot see any part of the file system except its application directory.
- Low trust – same as above except your code cannot make any out-of-process calls. i.e. calls to a database, network, etc.
- Minimal trust – code is restricted from anything but the most trival processing (calculating algorithms).
+3
source

Source: https://habr.com/ru/post/1787059/


All Articles