1
I’m having trouble adding to Servicereference, it adds normally but when it will generate the class "Client" it finds the following error:
No endpoints compatible with Silverlight 3 Were found. The generated client class will not be usable unless endpoint information is provided via the constructor.
When creating . svc I selected the new Silverlight compatible item. I’ve also tried to change the windows phone project to version 8.1 Silverlight but also without success. I read in some tutorials that this could be a bug of VS, but also that it had already been fixed (ie, I may be with the version of something outdated, but I’m with VS2015).
When inserting a new . svc and running it empty, it works right away, the problem starts to arise when I enter methods that return of type List<>, the weirdest thing is that the first time I created a WCF project I did the same process and it worked right away, I tried to insert this project (what worked) in Solution and it also did not work in this case.
.SVC:
[ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class CargaInicial : ICargaInicial
{
LojaService _lojaService = new LojaService();
UsuarioService _usuarioService = new UsuarioService();
ProdutoService _produtoService = new ProdutoService();
public Loja ObterLoja()
{
return _lojaService.ObterLoja();
}
public List<Usuario> ObterUsuarios()
{
return this._usuarioService.ObterUsuarios();
}
public List<Produto> ObterProdutos()
{
return _produtoService.ObterTodosProdutos();
}
}
Interface:
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class CargaInicial : ICargaInicial
{
LojaService _lojaService = new LojaService();
UsuarioService _usuarioService = new UsuarioService();
ProdutoService _produtoService = new ProdutoService();
public Loja ObterLoja()
{
return _lojaService.ObterLoja();
}
public List<Usuario> ObterUsuarios()
{
return this._usuarioService.ObterUsuarios();
}
public List<Produto> ObterProdutos()
{
return _produtoService.ObterTodosProdutos();
}
}
When entering the reference I used the following settings:
Product class:
[Table("Produto")]
public class Produto : Entity<Guid>, IProduto
{
[Required]
public string Codigo { get; set; }
[Required]
public string Descricao { get; set; }
[Required]
public decimal PrecoVenda { get; set; }
[Required]
public DateTime DataHoraUltimaAtualizacao { get; set; }
}
This class is from another project in the same Solution. I tried to insert the [Datacontract] and [Datamembercontract] but I still didn’t succeed.
Perhaps one solution is to change the version of Silverlight in the project, but I don’t know how to do this and I also have to use version 8.0 because it is a requirement.