我是WCF的新手.我期待步骤在IIS上部署WCF并使用该服务.我遵循与在IIS上部署网站相同的步骤,也将默认文档设置为Service1.svc
现在当我尝试使用这个wcf服务时,它给了我以下错误.
Metadata contains a reference that cannot be resolved: 'http://manish-pc:8000/Service1.svc?wsdl'.
The WSDL document contains links that could not be resolved.
There was an error downloading 'http://manish-pc:8000/Service1.svc?xsd=xsd0'.
The underlying connection was closed: An unexpected error occurred on a receive.
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
An existing connection was forcibly closed by the remote host
Metadata contains a reference that cannot be resolved: 'http://localhost:8000/Service1.svc'.
Content Type application/soap+xml; charset=utf-8 …Run Code Online (Sandbox Code Playgroud) 为什么我无法访问S类方法?为什么我能够在M类中创建具有相同名称的方法?
public class S
{
public S()
{
}
public int myFunc(int a, int b)
{
return a + b;
}
}
public class M:S
{
public M()
{
}
public string myFunc(int a, int b)
{
return (a + b).ToString();
}
}
public class Test
{
public static void Main(string[] args)
{
M mm = new M();
mm.myFunc(1,2); // Why I am not able to access S class myFunc
}
}
Run Code Online (Sandbox Code Playgroud)