Hi All ASP.net geeks,
I have just started working with .Net 2005 and developed my 1st app using ASP.net 2.0 and VB2005 with help of 'Small Business' template provided by microsoft.
This works fine on my local server but when I deployed it on Hosting server it gives an error.U can check it by visiting www.leelakagrains.com
that is:
Server Error in '/' Application.
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.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
-----------------------------------------------------
I have burned already a week but nothing got on forums.
The problem as I identified is :
Server at hosting company has Trust level = Medium setting in their Machine.config.
At my local PC/server, its Full so it runs fine but now to test I set it to 'Medium' and then tried to run the app , then I get this problem over my local server as well so its associated wid Trust Level.
The problematic code as I identify is:
Dim config As Configuration = WebConfigurationManager.OpenWebConfiguration("~")
It's in ThemesExpressionBuilder file of Small Business template.
If I deploy a page without master page or theme then it works fine. But I've customized n worked a lot on this theme.
I know the problem but I cann't resolve it coz:
1. My ISP will not let me host under Full Trust server.
2.I do not know why this Theme.... file need Full trust level.
3.What changes shud I do to run it under Medium trust level.
This problem I've noticed wid every starter kit or template provided by MS for ASP.net 2.0, I wonder why MS has done this to run these template apps under full trust when its common that ISP in shared hosting cann't provide u Full trust.
Pls helpe to solve this problem as I don want to design the whole app from the scratch. Suggest smthn so it could run under Medium trust leve.
Thanks in Advance.
Naveen K Agrawal
Enter your message below
Sign in or Join us (it's free).