Interface does not recognize class type even with declared DLL

Asked

Viewed 139 times

0

I created a Class Library project and in it a POCO class. I created an Interface (all following John Sharp’s book). Then I created my WS with WCF. Well, in the interface I declared a method of my class type created in Class Library and the interface did not recognize. I added the DLL to the project reference and I still can’t include it in the project. What should I do?

I am trying in several ways and without success. I have removed and added the DLL, restarted the machine and yet, nothing. Class is mapped with Datacontract. The code is like this:

using System.Data.Linq.Mapping;
using System.ServiceModel;
using System.Runtime.Serialization;

namespace SuporteTecnicoContracts
{ 
    [Table(Name="T_PDV")]
    [DataContract]
    public class TPDV
    {
        [Column]
        [DataMember]
        public int IDPdv { get; set; }
        [Column]
        [DataMember]
        public string CNPJ { get; set; }
        [Column]
        [DataMember]
        public string RazaoSocial { get; set; }
.......

My Interface

using System.ServiceModel.Web;
using SuporteTecnicoContracts;

namespace SuporteTecnico.Interface
{
    [ServiceContract]
    public interface ISuporteTecnicoContract
    {
        [OperationContract]
        [WebGet(UriTemplate = "/")]
        TPDV getCnpjParceiro(string _cnpj); ==> Não reconhece TPDV
    }
}
  • Just clearing up: TPDV is in a DLL and ISuporteTecnicoContract is in WS. WS references the DLL. Right?

  • It looks like this: A class library (Support) project that has TPDV. An interface that is in my main project, not in the library class that has the library class DLL. And an svc

1 answer

0


The following. I was with a svc within my main project. I created a new WCF Service Application project separately. I created and he created a project separately, getting my Solution with 5 projects. Thus solved the problem of recognizing the type mentioned above. This problem solved. I just don’t understand why you didn’t recognize when svc was in the same project.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.