Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GoDaddy hosting - How to solve Security Exception

I have a problem with new hosting in GoDaddy. Just for testing I created very simple ASP .NET MVC application without database etc. But GoDaddy triggers Security Exception for line @Html.ActionLink("Home", "Index", "Home") in my View. I don't understand the reason.

(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.)

like image 940
Petr Avatar asked Apr 19 '15 08:04

Petr


2 Answers

This can be done by two ways. 1 - Add following code in WebConfig <system.web> <trust level="Full" /> </system.web>

2- Go to Tools > NuGet Package Manager > Manage NuGet Packages for Solution in Visual Studio Find “DotNetCompilerPlatform” and uninstall it if present.

like image 142
Muhammad Qasim Hunain Avatar answered Nov 10 '22 18:11

Muhammad Qasim Hunain


If you use MVC 5 it is because MVC 5 no longer supports partial trust. You can Add this line to web.config file in section to grant full trust to code execution policy:

<system.Web>
...
    <trust level="Full"/>
...
</system.Web>
like image 38
alisabzevari Avatar answered Nov 10 '22 19:11

alisabzevari