Possible solution for BlogRoll items shown at Medium+ level

Topics: Controls
Aug 29, 2007 at 8:01 PM
Edited Aug 29, 2007 at 9:42 PM
Hi everyone and excuse me for starting a new thread about this one, while I don't know where else to post it since there are a fair amount of these blogroll issues. What's already known, is that the webhost server must run in High Trust. Medium or lower will result in no listed items, but here's the thing:

GoDaddy, my host (and probably many others), uses default medium trust level PLUS less-restrictive web permissions.
Source: http://help.godaddy.com/article.php?article_id=1039&topic_id=216

The blogroll.cs control only checks for default levels and starts the item fetch when level > medium. Since I was talking with tech support, I took the liberty to change two lines in blogroll.cs from > medium into > low (line 228-235) and then the blogroll feature (finally) completely works!

if (_CurrentLevel > AspNetHostingPermissionLevel.Medium) /// change that to .low
item.Request = (HttpWebRequest)WebRequest.Create(feedUrl); ;


if (_CurrentLevel > AspNetHostingPermissionLevel.Medium) /// change that to .low as well
item.Request.BeginGetResponse(ProcessRespose, item);

What I'm thinking now, this is not really a webhoster issue, right? Only checking for the default level is apparently not flexible enough, if the host / server is configured with less-restrictve web permissions too. Developers, please advise/comment - thanks in advance!

Best regards,
Aug 29, 2007 at 10:22 PM
Edited Aug 29, 2007 at 10:23 PM
Why not just fix BlogEngine to check and throw an Exception if it's not > medium and continue trying to do it... then if the exception is thrown, no big deal, we catch it because it was expected and note it in debug.

you could wrap the if statement with #DEBUG blocks so that in runtime it doesn't waste its time checking this and just does it, notes the exception when it doesn't work and continues... assuming you put the whole thing in a try catch

actually checking the trust level in code in order to enable features like this will just get you in trouble later when the definitions of the trust levels change over time (and yes, they will... stuff always does.)
Aug 30, 2007 at 11:32 AM
Great suggestions, William! Hopefully the BE.NET development team is picking this up.