I'm doing a course about webservices in C#, part of the course is set the webservice in IIS localhost, once it is working, I open a new project and create a client, make the reference, it refers correctly, and when I try to consume the method from the WS, it shows me this error:
System.ServiceModel.FaultException: 'System.Web.Services.Protocols.SoapException: El servidor no puede procesar la solicitud. ---> System.InvalidOperationException: No se puede serializar System.Security.Cryptography.KeySizes porque no tiene un constructor sin parámetros. en System.Xml.Serialization.TypeDesc.CheckSupported() en System.Xml.Serialization.TypeScope.GetTypeDesc(Type type, MemberInfo source, Boolean directReference, Boolean throwOnError) en System.Xml.Serialization.ReflectionAwareILGen.WriteReflectionInit(TypeScope scope) en System.Xml.Serialization.XmlSerializationWriterILGen.GenerateBegin() en System.Xml.Serialization.TempAssembly.GenerateRefEmitAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence) en System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence) en System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type) en System.Web.Services.Protocols.SoapServerType..ctor(Type type, WebServiceProtocols protocolsSupported) en System.Web.Services.Protocols.SoapServerProtocol.Initialize() en System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) --- Fin del seguimiento de la pila de la excepción interna ---'