When upgrading I had a lot of dependent modules that needed to be upgraded, to make the site build. I also changed the target framework to .NET 4.0. Finding the problem after all these changes was therefore quite complex.
- EPiServer assemblies from CMS 5 to CMS 6 R2
- Pagetype builder (PTB) from 126.96.36.199 to 188.8.131.52
- Castle.Core 184.108.40.206 to 220.127.116.11
- Remove the old Castle.DynamicProxy2.dll from \bin. (It was used by the old PTB version.)
The real error was hidden by the settings inside the server.serviceModel section in web.config. The EPiServer RemoteEventServiceEndPoint was set up using a udp protocol. Changing this to use a tcp protocol, I got the real error message:
"Unable to load one or more of the requested types. The following information may be a subset of the Type/LoaderException information present - inspect with debugger for complete view.
Check assemblies [Castle.DynamicProxy2, Version=18.104.22.168, Culture=neutral, PublicKeyToken=407dd0808d44fbdc] and/or types"
And that's how I figured it out.