Security Exception When Deploying Asp.net web application in Shared Hosting and Things to Consider

元气小坏坏 提交于 2020-01-23 17:27:27

问题


I'm looking to deploy a ASP.net web application in Shared Hosting.

I'm getting Security Exception,

System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Any help to fix and any other common issues that can be taken care when planing to deploy in Shared Hosting will be greatly appreciated.


回答1:


Many hosting providers will provide a control panel with which you can modify read/write permissions. Give that a shot.

Other common problems:

  1. Most only allow your app to run in Medium Trust. This could be the cause of your security problem.
  2. No remote TCP access (for security reasons) to your database (means you have to write a script or an 'installation' routine in your .NET app to create tables, relationships, constraints, etc.)
  3. Most of the time your app is put into an app pool with other shared apps, so when those apps explode, your app becomes collateral damage. Make sure you request that your app be placed in its own app pool to give it isolation from other apps' hiccups.



回答2:


Here's a good article on dealing with lower trust in an ASP.NET application.



来源:https://stackoverflow.com/questions/866515/security-exception-when-deploying-asp-net-web-application-in-shared-hosting-and

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!