Friday, November 21, 2008

Rhino Mock and "Type is not public, so a proxy cannot be generated"

When you try to create mock object using rhino mocks and object should implement internal interface you may get following error:
Type is not public, so a proxy cannot be generated
In order to fix it, put following line in interface assembly:




[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]


More information at: link

No comments: