Сведения об исключении: System.Security.SecurityException: запрос не выполнен - PullRequest
0 голосов
/ 14 марта 2020

Я развернул веб-сайт на сервере (Windows Хостинг).

Я получаю следующую ошибку:

Security Exception
Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request failed.

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.

Я искал и обнаружил, что решение заключается в добавлении следующий код в файл webconfig

<trust level="Full"/>

Но это приводит к ошибке

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: This configuration section cannot be used at this path.  This happens when the site administrator has locked access to this section using <location allowOverride="false"> from an inherited configuration file.

Source Error:


An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Line: 24

On Строка: 24 в файле webconfig:

<trust level="Full"/>

Как решить эту проблему?

Я использую Target Framework:. NET Framework 4.7.2

Редактировать

Вы можете проверить что Code Access Security уже установлено на Полный .

enter image description here

...