GoDaddy hosting - How to solve Security Exception
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.
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>