dasBlog, medium trust and pingbacks

I had an issue for quite a while with pingbacks in dasBlog:

Error:
System.Security.SecurityException:
Request for the permission of type 'System.Net.WebPermission, ...
failed.

at ...
at newtelligence.DasBlog.Runtime.Proxies.WeblogUpdatesClientProxy.Ping(String weblogName, String weblogUrl)

at newtelligence.DasBlog.Runtime.BlogDataServiceXml.PingWeblogsWorker(Object argument)

The action that failed was:

Demand

The type of the first permission that failed was:

System.Net.WebPermission

It comes up that medium trust allows opening connections only to originHost (I guess localhost).

Here's how I solved it:

go to

%windir%\Microsoft.NET\Framework\{version}\CONFIG\web_mediumtrust.config

and find

<IPermission class="WebPermission" ...

and add some additional URIs:

<IPermission
    class="WebPermission"
    version="1">

    <ConnectAccess>
        <URI uri="$OriginHost$"/>
            <!-- [Mihail Stoynov] dasBlog needs it for pingbacks START -->
            <URI uri="http://rpc.weblogs.com/RPC2"/>
            <URI uri="http://rpc.technorati.com/rpc/ping"/>
            <URI uri="http://ping.blo.gs/"/>
            <URI uri="http://rpc.pingomatic.com/"/>
            <URI uri="http://ping.feedburner.com"/>
            <URI uri="http://api.feedster.com/ping"/>
            <URI uri="http://xping.pubsub.com/ping/"/>
            <URI uri="http://api.my.yahoo.com/RPC2"/>
            <!-- [Mihail Stoynov] dasBlog needs it for pingbacks END -->
        </ConnectAccess>
</IPermission>

These addresses were in %dasBlog%\SiteConfig\WebServices.xml

Leave a Reply

Your email address will not be published.

Notify me of followup comments via e-mail. You can also subscribe without commenting.

This site uses Akismet to reduce spam. Learn how your comment data is processed.