Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 22nd, 2006, 03:05 PM
Registered User
 
Join Date: Oct 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Medium Trust

Hi,

Has anyone managed to get this working in a Medium Trust Hosting environment ?

Thanks,

Mike
 
Old October 22nd, 2006, 07:38 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Medium Trust is easier in 2.0 than it was in 1.1. I think most of this code will work fine. You'll probably need a medium trust policy file to deal with the problem cases.

http://msdn.microsoft.com/library/de...AGHT000020.asp

 
Old October 23rd, 2006, 05:45 AM
Registered User
 
Join Date: Oct 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I've read this article before, however the trouble I'm having is that it's very difficult to isolate the code that is causing the security access problems.

I've replicated the medium trust environment on my dev server by adding <trust level="Medium" /> in my web.config but I'm at a loss as to how to go about debugging as I simply get the security access error message which doesn't give me much of a clue.

Any help on how to tackle this would be much appreciated.

Thanks,

Mike
 
Old October 23rd, 2006, 06:17 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've never tried this myself. Can you bring up any of the pages? Have you tried tracing? Is there anything in the Windows Event Log?

Have you tried running a different 2.0 website - maybe just a simple page that shows a grid that gets data from SQL Server (using the web.config setting). You need to drop down to the basics and see what works. Then add a little complexity at a time until it breaks.

 
Old October 23rd, 2006, 09:17 PM
Authorized User
 
Join Date: May 2006
Location: , , .
Posts: 99
Thanks: 0
Thanked 1 Time in 1 Post
Default

I have worked with Medium Trust, but not with this code.

When working in a trust environment it's best to start out at the desired level of trust and develop from there. I'll plug a Wrox title here because I think it's the best book on this topic: Professional ASP NET 2.0 Security, Membership and Role Management


 
Old October 24th, 2006, 10:07 AM
Registered User
 
Join Date: Oct 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

On Englere's suggestion I eventually ended up looking up how to use the tracing aspects of ASP.Net, I must say that I hadn't realised how much info it gave. Incidentally if anyone has any good links describing the ins and outs of ASP.Net tracing let me know.

Anyhow through using the tracing I narrowed down the problem to be related to this:

http://msdn2.microsoft.com/en-us/lib...ermission.aspx

So with the web.config modified to that shown below the code now works fine in a medium trust hosting environment, the important addition being >> requirePermission="false" <<.

<configSections>
  <section name="theBeerHouse" requirePermission="false" type="MB.TheBeerHouse.TheBeerHouseSection, __code"/>
</configSections>

Thanks for all your help

p.s. MythicalMe: I've added the book you suggested to my wish list
 
Old October 24th, 2006, 05:52 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for sharing this with us. I hear that more shared hosting companies are moving to medium trust for their own protection.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Membership not working in Medium Trust stoverje BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 July 5th, 2008 10:43 AM
Medium trust problems DavidWilks BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 June 26th, 2007 03:51 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.