问题
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:
- Most only allow your app to run in Medium Trust. This could be the cause of your security problem.
- 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.)
- 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