ma jun

ma jun

  • NA
  • 6
  • 394

The Knowntype ("") method is not invoked

May 23 2018 8:46 PM
When I use ServiceBase to host WCF, the Knowntype ("") method is not invoked. The same code is normal when using the console for hosting. The only difference is that when the console is hosted, the administrator account is used, and the ServiceBase is used for NetworkService account permissions.
 public interface IDbo
{
[OperationContract]
Entity Get(Entity entity);
}
 
[KnownType("GetEntityType")]
[ServiceKnownType("GetEntityType")]
public class Entity{
private static Type[] GetEntityType() {
List list = new List();
list.Add(typeof(SplitPage));
return list.ToArray();