0

I have setup an application in Medium Trust Environment(.Net Trust Levels = Medium) and I am trying to load Favicon using Tilde(~) symbol in href but it throws an error.

<link rel="shortcut icon" href="~/Content/img/favicon.ico"/>

If I remove the ~ sign then the error goes off.

I am getting error as below :

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 for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Any Suggestions?

Thanks

Shubh
  • 6,693
  • 9
  • 48
  • 83
  • 1
    MVC-5 only supports full trust. Refer [this answer for more details](http://stackoverflow.com/questions/25347092/deploying-asp-net-mvc-project/25354496#25354496) –  Apr 29 '15 at 11:51
  • If that is the case then I have to rewite many things. :( – Shubh Apr 29 '15 at 11:55
  • Why do you need medium trust? The only reason you would use this is if you're using shared application pools (the default in IIS6). These days "dedicated pool per site" is the norm with your app pool/site running as "Application Pool Identity" (see also: http://stackoverflow.com/a/17218344/419) – Kev Apr 29 '15 at 17:40
  • I am using GoDaddy which provides Medium Trust only :( – Shubh Apr 30 '15 at 06:16

0 Answers0