0

I developed a website based on MVC5+ working fine on local server. But I tried to published on remote server(shared) it throws exception System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

I add fulltrust in my web.config file but failed and contact Service Provider. They said that he can not provide full trust access on shared server and I need to buy dedicated server which is very costly.

I tried to role back MVC4 even this fail.

Please share your Idea with to resolve this issue.

Many Many Thanks in Advance

Own
  • 174
  • 1
  • 11
  • Also [Deploying ASP.NET MVC Project](http://stackoverflow.com/questions/25347092/deploying-asp-net-mvc-project/25354496#25354496) – stuartd Jul 09 '16 at 14:55
  • I found a lot of Question but not a single solution except adding full trust but Remote Server Does not allow to provide full trust. So I am searching alternate solution if any which can be host on shared server. Mention bottom solution is the only improvement explanation but not a solution. – Own Jul 09 '16 at 15:11
  • 1
    You cannot run MVC 5 with partial trust. Either find a server that allows full trust or downgrade to MVC 4 – stuartd Jul 09 '16 at 18:07
  • @stuartd Thanks for reply. I create new MVC5+ project without any template and it is working on shared server. So the problem is in template. When I tried to add mannualy it was working and when I change Bundle Config. It start giving same project. So the issue may be in Tenplate. – Own Jul 21 '16 at 08:59
  • As long as you don't use any packages that [make use of reflection](http://stackoverflow.com/questions/1160924/what-risk-does-reflection-pose-medium-trust), it should be OK. – stuartd Jul 21 '16 at 09:30

0 Answers0