Has anyone out there been successful at creating a CRM 2011 Online Early Binding Plug-in that works? I'm struggling with one I'm working on and was curious. I haven't seen any documentation anywhere that says you cannot early bind a CRM 2011 online plugin but I also haven't seen any examples of this specifically out there either. I've scoured the web, blogs, sdk, kit and msdn. Nothing has this as an example. If anyone has a template on how to do this I would appreciate it. Then I can compare what I have with where I went wrong.
What I'm trying to do is create an early binding plug-in that copies a specified Opportunity to a New Opportunity along with it's Opportunity Products. Sounds simple enough, right?
The Issue is I get an exception from the plugin stating:
Unexpected exception from plug-in (Execute): XRM.Plugins.CopyOpportunity.CopyOpportunity: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
This is occuring on the following line of code in my plugin:
using (_serviceProxy = new OrganizationServiceProxy(serverConfig.OrganizationUri, serverConfig.HomeRealmUri, serverConfig.Credentials, serverConfig.DeviceCredentials))
I did generate the device credentials and am using those. Also generated the early binding class with the CrmSvcUtil. That class file is included in my VS project and resolves. The project compiles with no warnings. I also have a server connection class in my project to build the properties and values for the serverConfig parameters being passed into the function above. I did verify that they are getting values.
Any insight would be greatly appreciated.
Thx.
Aaron
Aaron