Update...
Okay, I tried again on the server, and managed to get the permission into
the .net configuration utility by actually adding the <PermissionSet />
element to the XML file you asked me to create.
Unfortunately it didn't work - even when I added it to Local Intranet and
Internet zones.
However, I did a Ctrl-F5 build and it failed and asked me if I wanted to run
the last successful build, so I selected yes, and it gave me a stack trace!
Here's the result...
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.Web.AspNetHostingPermission, System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Stack Trace:
[SecurityException: Request for the permission of type
'System.Web.AspNetHostingPermission, System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.RuntimeTypeHandle._GetTypeByName(String name, Boolean
throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&
stackMark, Boolean loadTypeFromPartialName) +0
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError,
Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +72
System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError,
Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +58
System.Type.GetType(String typeName, Boolean throwOnError, Boolean
ignoreCase) +64
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean
throwOnError, Boolean ignoreCase) +48
System.Web.Configuration.ConfigUtil.GetType(String typeName, String
propertyName, ConfigurationElement configElement, XmlNode node, Boolean
checkAptcaBit, Boolean ignoreCase) +31
-----------------------------------------------------
It definently looks like the issue you talked about, but I can't work out
how to get it to work. Any more suggestions would be greatly appreciated!
Cheers
Dan
"Yuan Ren[MSFT]" said:
Hi Dan,
Thanks for your reply!
I'm sorry for unclear questions. After my researching, the current problem
seems a known issue. I suggest you try to perform some steps as below:
1 <IPermission class="System.Web.AspNetHostingPermission, System, Version=
2.0.0.0,
Culture=neutral, PublicKeyToken= b77a5c561934e089" Level="Unrestricted" />
Save the string in an XML file. Then open Microsoft .NET Framework 2.0
Configuration Console and expand till:
Runtime Security Policy >> Machin >> Code Groups >> All_Code.>>
My_Computer_Zone.
2 Right click the "My_Computer_Zone" and select "New".
3 Give a proper name for new code group and click "Next".
4 Choose All Code from the only dropdown list and click next.
5 Select Create a new permission set option and click next.
6 Give a proper name to new permission set. And click next.
7 In the middle of the window, down bottom, click "Import..." button.
8 Locate the xml file in which we have saved the permission set string.
9 Click next and then finish.
10 Repeat the same with "LocalIntranet_Zone" and "Internet_Zone" if this
doesn't resolve the problem, please restart the IIS services.
I hope the above information helps, if you have any questions or concerns,
please do not hesitate to let me know. I am standing by to help you.
Regards,
Yuan Ren [MSFT]
Microsoft Online Support