K
K
kati_1112014-12-06 12:20:30
WCF
kati_111, 2014-12-06 12:20:30

Error while publishing service "Could not find contract name 'XXX' in the list of contracts implemented by the service. What can I do?

I'm trying to publish a simple service
namespace SCI_App1
{
[ServiceContract]
public interface ISimpleService
{
[OperationContract]
string SimpleMethod(string msg);
}
public class SimpleService : ISimpleService
{
public string SimpleMethod(string msg)
{
return "Hello ";
}
}
}
Throws an error when calling: Could not find contract name 'SCI_App1.ISimpleService' in the list of contracts implemented by service 'SimpleService'.
I've looked all over and can't find the reason.
Maybe someone has come across this.
It may be due to the fact that it also produces such a warning:
CS1685: The predefined type 'System.Collections.Specialized.INotifyCollectionChanged' is defined in multiple assemblies in a global alias; the definition from "c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" is
used. I have a Silverlight project, respectively uses the System.Windows.dll and System.ServiceModel.dll libraries version 5.0.5.0, and some libraries look at the same versions of earlier versions. In GAC_MSIL - 4th version.
I tried to add the 5th version in GAC_MSIL and configure dependentAssembly in web.config. But it didn't help. publicKeyToken, then the net and silverlight versions of the libraries are different...
Here is the web.config:
<?xml version="1.0" encoding="utf-8"?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kati_111, 2014-12-15
@kati_111

The problem was in the versions of the System.ServiceModel.dll assemblies.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question