FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister  MasterVB.NET
Visual Basic 2005 .NET Forum
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Medium Trust Level
 
Post new topic   Reply to topic    MasterVB.NET Forum Index -> Web Forms
View previous topic :: View next topic  
Message
Author
drosensnap
Newbie
Joined: 18 Jul 2006
Posts: 9

PostPosted: Tue Jul 18, 2006 4:00 am    
Post subject: Medium Trust Level
Reply with quote

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.



 

Back to top
View user's profile Send private message
Author
MichaelSchwarz
Intermediate
Joined: 11 Jul 2006
Posts: 252

PostPosted: Tue Jul 18, 2006 4:00 am    
Post subject:
Reply with quote

Are you using the latest version without the web events?

Regards,
Michael


On 7/17/06, drosensnap <dr2050> wrote:
Quote:

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.


>



--

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


 

Back to top
View user's profile Send private message
Author
drosensnap
Newbie
Joined: 18 Jul 2006
Posts: 9

PostPosted: Tue Jul 18, 2006 4:00 am    
Post subject:
Reply with quote

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



 

Back to top
View user's profile Send private message
Author
drosensnap
Newbie
Joined: 18 Jul 2006
Posts: 9

PostPosted: Wed Jul 19, 2006 4:00 am    
Post subject:
Reply with quote

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?


[PolicyException: Required permissions cannot be acquired.]
[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)]



 

Back to top
View user's profile Send private message
Author
AlbertWeinert
Newbie
Joined: 12 Jul 2006
Posts: 42

PostPosted: Wed Jul 19, 2006 4:00 am    
Post subject:
Reply with quote

drosensnap schrieb:

Quote:
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


 

Back to top
View user's profile Send private message
Author
drosensnap
Newbie
Joined: 18 Jul 2006
Posts: 9

PostPosted: Wed Jul 19, 2006 4:00 am    
Post subject:
Reply with quote

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!



 

Back to top
View user's profile Send private message
Author
MichaelSchwarz
Intermediate
Joined: 11 Jul 2006
Posts: 252

PostPosted: Wed Jul 19, 2006 4:00 am    
Post subject:
Reply with quote

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:
Quote:

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.


>



--

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


 

Back to top
View user's profile Send private message
Author
drosensnap
Newbie
Joined: 18 Jul 2006
Posts: 9

PostPosted: Wed Jul 19, 2006 4:00 am    
Post subject:
Reply with quote

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.



 

Back to top
View user's profile Send private message
Author
MichaelSchwarz
Intermediate
Joined: 11 Jul 2006
Posts: 252

PostPosted: Wed Jul 19, 2006 4:00 am    
Post subject:
Reply with quote

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:
Quote:

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


 

Back to top
View user's profile Send private message
Author
drosensnap
Newbie
Joined: 18 Jul 2006
Posts: 9

PostPosted: Wed Jul 19, 2006 4:00 am    
Post subject:
Reply with quote

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



 

Back to top
View user's profile Send private message
Author
MichaelSchwarz
Intermediate
Joined: 11 Jul 2006
Posts: 252

PostPosted: Wed Jul 19, 2006 4:00 am    
Post subject:
Reply with quote

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:
Quote:
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


 

Back to top
View user's profile Send private message
Author
drosensnap
Newbie
Joined: 18 Jul 2006
Posts: 9

PostPosted: Wed Jul 19, 2006 4:00 am    
Post subject:
Reply with quote

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.



 

Back to top
View user's profile Send private message
Author
MichaelSchwarz
Intermediate
Joined: 11 Jul 2006
Posts: 252

PostPosted: Wed Jul 19, 2006 4:00 am    
Post subject:
Reply with quote

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:
Quote:

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


 

Back to top
View user's profile Send private message
Author
AlbertWeinert
Newbie
Joined: 12 Jul 2006
Posts: 42

PostPosted: Wed Jul 19, 2006 4:00 am    
Post subject:
Reply with quote

drosensnap schrieb:

Quote:
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


 

Back to top
View user's profile Send private message
Author
drosensnap
Newbie
Joined: 18 Jul 2006
Posts: 9

PostPosted: Wed Jul 19, 2006 4:01 am    
Post subject:
Reply with quote

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:
Quote:
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




 

Back to top
View user's profile Send private message
Author
AlbertWeinert
Newbie
Joined: 12 Jul 2006
Posts: 42

PostPosted: Thu Jul 20, 2006 4:00 am    
Post subject:
Reply with quote

drosensnap schrieb:

Quote:
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


 

Back to top
View user's profile Send private message
Author
MichaelSchwarz
Intermediate
Joined: 11 Jul 2006
Posts: 252

PostPosted: Thu Jul 20, 2006 4:00 am    
Post subject:
Reply with quote

Give me 20 minutes more and I will put it online... ;)


On 7/19/06, Albert Weinert <albert.weinert> wrote:
Quote:

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


 

Back to top
View user's profile Send private message
Author
AlbertWeinert
Newbie
Joined: 12 Jul 2006
Posts: 42

PostPosted: Thu Jul 20, 2006 4:00 am    
Post subject:
Reply with quote

Michael Schwarz schrieb:

Quote:
Give me 20 minutes more and I will put it online... ;)

Run Forrest, run ...



--
Freundliche Grüße

Albert Weinert

http://der-albert.com


 

Back to top
View user's profile Send private message
Author
MichaelSchwarz
Intermediate
Joined: 11 Jul 2006
Posts: 252

PostPosted: Thu Jul 20, 2006 4:00 am    
Post subject:
Reply with quote

Download at http://www.ajaxpro.info/, version 6.7.19.1.

Regards,
Michael


On 7/19/06, Albert Weinert <albert.weinert> wrote:
Quote:

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


 

Back to top
View user's profile Send private message
Author
drosensnap
Newbie
Joined: 18 Jul 2006
Posts: 9

PostPosted: Thu Jul 20, 2006 4:00 am    
Post subject:
Reply with quote

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:
Quote:
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... Wink
>
> 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




 

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    MasterVB.NET Forum Index -> Web Forms All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Archieve

Powered by phpBB © 2001, 2002 phpBB Group, used in Visual Basic 2005 .NET Forum

| Visual Basic .NET Forum | Online Recipe Archiver | Shareware Freeware PAD | Lowongan Kerja | Kamus Online | Health Supply | Digital Camera Review |
Orang Paling Keren

RSS