When using an ASP.Net application (so, with a compiled source assembly) you may encounter this error.
This can occur in many circumstances, but in my case when the ASP.NET page has a src tag and not a code behind tag. This produce an other assembly for the page that is concurencing the actual generated application assembly, so ASP.NET can't choose the good one. By changing the src attribute by the CodeBehind attribute, this is solved.
Ex:
<%@ Control Language="C#" src="test.ascx.cs" Inherits="Assembly.namespace.test" AutoEventWireUp="false" %>
by
<%@ Control Language="C#" codebehind="test.ascx.cs" Inherits="Assembly.namespace.test" AutoEventWireUp="false" %>
-f.