I have a web site designed in ASP.NET (VB) that worked fine on my older server (Windows Server 2003 and IIS 6.x). I have moved it to a Windows Server 2008 R2 with IIS 7.x. Most of the site has been working for months. However, I tried going into edit
mode (clicking the Edit button on the formview) on a formview (which used to work on the old server and IIS 6), and I now get:
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.
What might I need to change?
Dr. Douglas Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org
Its due to the security setting and permissions of your directory in the web server,
What happens in your code is the application attempted to perform an operation (execute external programme) not allowed by the security policy. For testing purposes you can try to add this line in your web.config if host admin doesn't lock the trust level
section.
If it's a share host, you probably need to discuss with your hosting provider and get some restrictions on what you can and cannot do. For security reasons, Most share host will restrict execute extrnol programme.
Parthasarathi,
Remember to click Mark as Answer on the post that helps to others.
Chaplain Dou...
Member
305 Points
934 Posts
FormView Throws a Security Error
Nov 19, 2012 04:58 PM|LINK
I have a web site designed in ASP.NET (VB) that worked fine on my older server (Windows Server 2003 and IIS 6.x). I have moved it to a Windows Server 2008 R2 with IIS 7.x. Most of the site has been working for months. However, I tried going into edit mode (clicking the Edit button on the formview) on a formview (which used to work on the old server and IIS 6), and I now get:
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.
What might I need to change?
Good News Jail & Prison Ministry
www.goodnewsjail.org
sarathi125
Star
13599 Points
2691 Posts
Re: FormView Throws a Security Error
Nov 20, 2012 03:40 AM|LINK
Hi,
Its due to the security setting and permissions of your directory in the web server,
What happens in your code is the application attempted to perform an operation (execute external programme) not allowed by the security policy. For testing purposes you can try to add this line in your web.config if host admin doesn't lock the trust level section.
<system.web>
<trust level="Full" originUrl="" />
</system.web>
A more prosaic approach is looking into the call stack and using the custom permission set for security policy.
Here you can get more information
http://msdn2.microsoft.com/en-us/library/tkscy493(VS.80).aspx
If it's a share host, you probably need to discuss with your hosting provider and get some restrictions on what you can and cannot do. For security reasons, Most share host will restrict execute extrnol programme.
Remember to click Mark as Answer on the post that helps to others.
My Blog :MyAspSnippets
dotnetnerd
Contributor
2368 Points
538 Posts
Re: FormView Throws a Security Error
Nov 20, 2012 05:47 AM|LINK
Hi chaplain,
Please make sure that your site is runnning on Full Trust mode.
Windows ASP.NET Hosting | Reseller Hosting | Cloud Hosting
Chaplain Dou...
Member
305 Points
934 Posts
Re: FormView Throws a Security Error
Nov 20, 2012 03:17 PM|LINK
Adding the <trust level="full" . . . /> as you suggested worked. Thank you.
Why did it not need that on IIS 6.x and now needs it on IIS 7.x?
Good News Jail & Prison Ministry
www.goodnewsjail.org