Xiaocheng Tong


I have an Add-In developed based on Windows Live Messnger Add-In API, and in this Add-In, I'd like to use the "MetaWeblog API for Windows Live Spaces". However, when I call these MetaWeblog API, I get this error message "Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."

If I call these MetaWeblog API in an isolate App, they can be made successfully, and certainly there isn't any error message.

Anybody have any idea to make my add-in have the code access permission

Thanks in advance!





Re: Live Messenger Add-In has not enough Code Access Permission

coolio


Sign your assembly with a strong key and have it registered in the GAC. That will do the job.

hth,

- coolio






Re: Live Messenger Add-In has not enough Code Access Permission

NOSA

easy. Search MessengerClient.dll source code.(use Reflector.exe)

look here:

namespace MS.MessengerHost

Class: PlugInHost

function:IntPtr IPlugInLauncher.LaunchUserCode(string strAssemblyFileName, IntPtr messengerClientInternal)

Change code : domainPolicy.RootCodeGroup = new UnionCodeGroup(new AllMembershipCondition(), new PolicyStatement(domainPolicy.GetNamedPermissionSet("Internet")));

to

domainPolicy.RootCodeGroup = new UnionCodeGroup(new AllMembershipCondition(), new PolicyStatement(domainPolicy.GetNamedPermissionSet("FullTrust")));

re-building......hehe.







Re: Live Messenger Add-In has not enough Code Access Permission

coolio

Nice, but that won't work. Since the MessengerClient.dll is signed with a strong key (you don't have), the Live Messenger won't load your custom rebuild dll. 

hth,

-coolio