GoDaddy hosting - How to solve Security Exception
Asked Answered
S

4

10

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

Swadeshi answered 19/4, 2015 at 8:39 Comment(0)
T
32

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>
Threescore answered 19/4, 2015 at 9:16 Comment(3)
Answer is correct, but can you explain where in the web.config to add this? system.web should be the root where it is added. Here is the post that helped me msdn.microsoft.com/en-us/library/tkscy493(v=vs.85).aspxKessinger
Wasted several hours before finding this! This should be on GoDaddy's support site.Grundy
I had to do 2 things to get MVC app to work on GoDaddy's Plesk hosting 1) Uninstall nuget package Microsoft.CodeDom.Providers.DotnetCompilerPlatform 2) Set trust level to FullCordon
A
8

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.

Allograph answered 23/12, 2016 at 10:32 Comment(0)
S
0

OK I found the solution. I had to change CAS trust level from medium to full in the settings. https://support.godaddy.com/help/article/8999/do-your-hosting-accounts-support-mvc4-and-mcv5-applications?countrysite=uk

Swadeshi answered 19/4, 2015 at 9:12 Comment(0)
H
0

thanks friend, in my case I had to do the 3 things, change the web.config so... trust level="Full" processRequestInApplicationTrust="false", , uninstall the "DotNetCompilerPlatform", and change the confidence level CAS on the server

Highchair answered 23/5, 2019 at 20:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.