Failed to create receiver object from assembly

I added a new Feature with EventReceiver to my Solution. While trying to activate this WebApplication feature I got the errormessage, that Sharepoint “Failed to create receiver object from assembly“.

What caused the error?

The SharePoint Timer service cached the old DLL. After re-deploying my solution the cache wasn’t cleared. The reference to my EventReveiver wasn’t found in the old DLL.

What’s the solution?

Restart the SharePoint Timer Service on all servers in the farm.

A proxy type with the name account has been defined by another assembly

I wanted to display different entities from Dynamics CRM in my SharePoint site using the CRM webservice. My code worked while I only had one solution, connection to CRM, deployed on my server. When I wrote a second application that is also using the webservice, I got the following error:
“A proxy type with the name account has been defined by another assembly.”

Here’s the solution. You just have to add a new ProxyTypesBehavior:

ClientCredentials credentials = new ClientCredentials();
credentials.Windows.ClientCredential = new NetworkCredential(username, password, domain);
credentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
IServiceConfiguration<IOrganizationService> orgConfigInfo = ServiceConfigurationFactory.CreateConfiguration<IOrganizationService>(new Uri(@"[...]/XRMServices/2011/Organization.svc"));
OrganizationServiceProxy client = new OrganizationServiceProxy(orgConfigInfo, credentials);
client.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior(Assembly.GetExecutingAssembly()));