|
Medium Trust Level -- drosensnap --
Hi this was a topic before, but it was closed with no resolution. It is true as far as I can tell. Ajax.NET Pro does not work under medium trust. This may be due to its use of reflection. To make your web app medium trust, add this line <trust level="Medium" originUrl="" processRequestInApplicationTrust="true" /> to the <system.web> section. Godaddy is my hosting provider (see medium trust with them at http://help.godaddy.com/article.php?article_id=1039&topic_id=216 &&) and it will not work there in its current form.I imagine that you could use the AjaxPro JSON libs with no problem... I'll start looking into these solutions next. |
|
-- MichaelSchwarz --
Are you using the latest version without the web events? Regards, Michael On 7/17/06, drosensnap <dr2050> wrote: Hi this was a topic before, but it was closed with no resolution. It is true as far as I can tell. Ajax.NET Pro does not work under medium trust. This may be due to its use of reflection. To make your web app medium trust, add this line <trust level="Medium" originUrl="" processRequestInApplicationTrust="true" /> to the <system.web> section. Godaddy is my hosting provider (see medium trust with them at http://help.godaddy.com/article.php?article_id=1039&topic_id=216 &&) andit will not work there in its current form. I imagine that you could use the AjaxPro JSON libs with no problem... I'll start looking into these solutions next. > -- Best regards | Schöne Grüße Michael Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer http://weblogs.asp.net/mschwarz /http://www.schwarz-interactive.de /mailto:info |
|
-- drosensnap --
as far as I know, I'm using 6.7.11.1 and I only included the AjaxPro.2.dll. Should it work the other way? Thanks! Best, Daniel |
|
-- drosensnap --
There are four errors (which I see as just one on Godaddy). They don't really tell you which security permission is missing. Is there a workaround? [FileLoadException: Could not load file or assembly 'AjaxPro.2, Version=6.7.11.1, Culture=neutral, PublicKeyToken=4735ae9824c7d3ec' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)] [ConfigurationErrorsException: Could not load file or assembly 'AjaxPro.2, Version=6.7.11.1, Culture=neutral, PublicKeyToken=4735ae9824c7d3ec' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)] [HttpException (0x80004005): Could not load file or assembly 'AjaxPro.2, Version=6.7.11.1, Culture=neutral, PublicKeyToken=4735ae9824c7d3ec' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)] |
|
-- AlbertWeinert --
drosensnap schrieb: There are four errors (which I see as just one on Godaddy). They don't really tell you which security permission is missing. Did you do a requirePermission="false" in the <section /> definition? -- Freundliche Grüße Albert Weinert http://der-albert.com |
|
-- drosensnap --
I have NO explicit references to the AjaxPro.2.dll in the web.config. If the DLL is in the bin directory, the app won't start. What kind of section tag should I put in? Thanks! |
|
-- MichaelSchwarz --
I read the help article that is saying: "Applications operating under a Medium trust level have no registry access, no access to the Windows event log, and cannot use reflection..." AjaxPro is using reflection all the time, so you will not be able to run it, as I can see. Regards, Michael On 7/17/06, drosensnap <dr2050> wrote: Hi this was a topic before, but it was closed with no resolution. It is true as far as I can tell. Ajax.NET Pro does not work under medium trust. This may be due to its use of reflection. To make your web app medium trust, add this line <trust level="Medium" originUrl="" processRequestInApplicationTrust="true" /> to the <system.web> section. Godaddy is my hosting provider (see medium trust with them at http://help.godaddy.com/article.php?article_id=1039&topic_id=216 &&) andit will not work there in its current form. I imagine that you could use the AjaxPro JSON libs with no problem... I'll start looking into these solutions next. > -- Best regards | Schöne Grüße Michael Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer http://weblogs.asp.net/mschwarz /http://www.schwarz-interactive.de /mailto:info |
|
-- drosensnap --
NO! GoDaddy says that, but they're a bunch of hacks. As far as I know, "Medium trust doesn't have access to protected members for Reflection." ( http://west-wind.com/weblog/posts/6344.aspx ).This is, anyway, NOT the problem... first I have to get the assembly to LOAD under medium trust. I think Albert's point is right, I just have to see how to have it apply to the ajax.net assemblies. |
|
-- MichaelSchwarz --
I did some tests already with medium trust level and the only way to get it running with removed ReflectionPermission was to create your own policy file. But his is not working with GoDaddy, as I read in a news group (sorry, forgot where). Did you try to add your own policy file and configured it in your web.config? I think it will not work because own policy files are forbidden, too. Regards, Michael On 7/18/06, drosensnap <dr2050> wrote: NO! GoDaddy says that, but they're a bunch of hacks. As far as I know, "Medium trust doesn't have access to protected members for Reflection." ( http://west-wind.com/weblog/posts/6344.aspx ).This is, anyway, NOT the problem... first I have to get the assembly to LOAD under medium trust. I think Albert's point is right, I just have to see how to have it apply to the ajax.net assemblies. > -- Best regards | Schöne Grüße Michael Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer http://weblogs.asp.net/mschwarz /http://www.schwarz-interactive.de /mailto:info |
|
-- drosensnap --
Okay, there is no way to fix this in the web.config. I think it's one of the attributes you're using for the DLLs (both AjaxPro2 and AjaxProJson2). In your assembly config for each of the DLLs you've probably got a line like this [assembly: PermissionSet(SecurityAction.RequestMinimum, Unrestricted = true)] If this were removed and you made the DLLs available, I would be VERY HAPPY to test again in my medium trust environment and on GoDaddy. See http://blogs.msdn.com/shawnfa/archive/2004/12/06/276066.aspx |
|
-- MichaelSchwarz --
http://groups.google.com/group/ajaxpro/browse_thread/thread/7180f560b493beb3/853c244a55af766a?q=medium+trust&lnk=gst&rnum=2#853c244a55af766a On 7/18/06, Michael Schwarz <michael.schwarz> wrote: I did some tests already with medium trust level and the only way to get it running with removed ReflectionPermission was to create your own policy file. But his is not working with GoDaddy, as I read in a news group (sorry, forgot where). Did you try to add your own policy file and configured it in your web.config? I think it will not work because own policy files are forbidden, too. Regards, Michael On 7/18/06, drosensnap <dr2050> wrote: > > NO! GoDaddy says that, but they're a bunch of hacks. > > As far as I know, "Medium trust doesn't have access to protected > members for Reflection." ( http://west-wind.com/weblog/posts/6344.aspx ).> > > This is, anyway, NOT the problem... first I have to get the assembly to > LOAD under medium trust. I think Albert's point is right, I just have > to see how to have it apply to the ajax.net assemblies. > > > > > > -- Best regards | Schöne Grüße Michael Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer http://weblogs.asp.net/mschwarz /http://www.schwarz-interactive.de /mailto:info -- Best regards | Schöne Grüße Michael Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer http://weblogs.asp.net/mschwarz /http://www.schwarz-interactive.de /mailto:info |
|
-- drosensnap --
Okay, tried that and not surprisingly it did NOT work. "This configuration section cannot be used at this path. This happens when the site administrator has locked access to this section using <location allowOverride="false"> from an inherited configuration file." I repeat my question: DO YOU REALLY NEED REFLECTION PERMISSION? We all do reflection all the time under medium trust... the reflection permission is NOT about getting types and methods of objects. 1) See http://blogs.msdn.com/shawnfa/archive/2005/03/08/389768.aspx 2) What happens if you remove your PermissionSet statements from your assembly? I bet most of the functionality would still work.Thanks for taking this problem seriously, since medium trust is pretty standard on a lot of the bigger ISPs. |
|
-- MichaelSchwarz --
Is it possible to contact me at my private mail to run some tests? Reflection is used everywhere inside AjaxPro. Michael On 7/18/06, drosensnap <dr2050> wrote: Okay, tried that and not surprisingly it did NOT work. "This configuration section cannot be used at this path. This happens when the site administrator has locked access to this section using <location allowOverride="false"> from an inherited configuration file." I repeat my question: DO YOU REALLY NEED REFLECTION PERMISSION? We all do reflection all the time under medium trust... the reflection permission is NOT about getting types and methods of objects. 1) See http://blogs.msdn.com/shawnfa/archive/2005/03/08/389768.aspx 2) What happens if you remove your PermissionSet statements from your assembly? I bet most of the functionality would still work. Thanks for taking this problem seriously, since medium trust is pretty standard on a lot of the bigger ISPs. > -- Best regards | Schöne Grüße Michael Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer http://weblogs.asp.net/mschwarz /http://www.schwarz-interactive.de /mailto:info |
|
-- AlbertWeinert --
drosensnap schrieb: I have NO explicit references to the AjaxPro.2.dll in the web.config. If the DLL is in the bin directory, the app won't start. What kind of section tag should I put in? <configSections> <sectionGroup name="ajaxNet"> <section name="ajaxSettings" type="AjaxPro.AjaxSettingsSectionHandler,AjaxPro.2" requirePermission="false" restartOnExternalChanges="true"/> </sectionGroup> </configSections> -- Freundliche Grüße Albert Weinert http://der-albert.com |
|
-- drosensnap --
Thanks Albert. Tried that, did not work. as I said in another message, if the DLL were compiled with other permissions, the DLL would load (and perhaps blow up along the way). As I've said elsewhere, I think that the reflection permission is NOT necessary for Ajax.NET Pro. Best, Daniel Albert Weinert wrote: drosensnap schrieb: > I have NO explicit references to the AjaxPro.2.dll in the web.config. > If the DLL is in the bin directory, the app won't start. What kind of > section tag should I put in? <configSections> <sectionGroup name="ajaxNet"> <section name="ajaxSettings" type="AjaxPro.AjaxSettingsSectionHandler,AjaxPro.2" requirePermission="false" restartOnExternalChanges="true"/> </sectionGroup> </configSections> -- Freundliche Grüße Albert Weinert http://der-albert.com |
|
-- AlbertWeinert --
drosensnap schrieb: Tried that, did not work. as I said in another message, if the DLL were compiled with other permissions, the DLL would load (and perhaps blow up along the way). As I've said elsewhere, I think that the reflection permission is NOT necessary for Ajax.NET Pro. Your right, it's not working with 6.7.11.1. It works without a problems with some older version. The good thing is, an update is coming which fixes that problem. I tested it before a couple of minutes, it even works in Low-Trust. -- Freundliche Grüße Albert Weinert http://der-albert.com |
|
-- MichaelSchwarz --
Give me 20 minutes more and I will put it online... ;) On 7/19/06, Albert Weinert <albert.weinert> wrote: drosensnap schrieb: > Tried that, did not work. as I said in another message, if the DLL > were compiled with other permissions, the DLL would load (and perhaps > blow up along the way). As I've said elsewhere, I think that the > reflection permission is NOT necessary for Ajax.NET Pro. Your right, it's not working with 6.7.11.1. It works without a problems with some older version. The good thing is, an update is coming which fixes that problem. I tested it before a couple of minutes, it even works in Low-Trust. -- Freundliche Grüße Albert Weinert http://der-albert.com > -- Best regards | Schöne Grüße Michael Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer http://weblogs.asp.net/mschwarz /http://www.schwarz-interactive.de /Skype: callto:schwarz-interactive MSN IM: passport |
|
-- AlbertWeinert --
Michael Schwarz schrieb: Give me 20 minutes more and I will put it online... ;) Run Forrest, run ... -- Freundliche Grüße Albert Weinert http://der-albert.com |
|
-- MichaelSchwarz --
Download at http://www.ajaxpro.info /, version 6.7.19.1.Regards, Michael On 7/19/06, Albert Weinert <albert.weinert> wrote: Michael Schwarz schrieb: > Give me 20 minutes more and I will put it online... ;) Run Forrest, run ... -- Freundliche Grüße Albert Weinert http://der-albert.com > -- Best regards | Schöne Grüße Michael Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer http://weblogs.asp.net/mschwarz /http://www.schwarz-interactive.de /Skype: callto:schwarz-interactive MSN IM: passport |
|
-- drosensnap --
That worked! Both under medium trust (specified in a web.config) and on my "medium trust" ISP, Godaddy. Thanks so much! Now I have to go play with the Ajax.NET Pro... Michael Schwarz wrote: http://www.ajaxpro.info /, version 6.7.19.1.Regards, Michael On 7/19/06, Albert Weinert <albert.weinert> wrote: > > Michael Schwarz schrieb: > > > Give me 20 minutes more and I will put it online... ;) > > Run Forrest, run ... > > > -- > Freundliche Grüße > > Albert Weinert > > http://der-albert.com > > > > -- Best regards | Schöne Grüße Michael Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer http://weblogs.asp.net/mschwarz /http://www.schwarz-interactive.de /Skype: callto:schwarz-interactive MSN IM: passport |