Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 参考web服务运行表单应用程序时出错_C#_Asp.net_Web Services - Fatal编程技术网

C# 参考web服务运行表单应用程序时出错

C# 参考web服务运行表单应用程序时出错,c#,asp.net,web-services,C#,Asp.net,Web Services,我有一个简单的web服务应用程序,它引用了 我在Service1.asmx.cs中的主要功能如下所示: public com.cdyne.wsf.WeatherReturn HelloWorld( string zip) { com.cdyne.wsf.WeatherReturn x; com.cdyne.wsf.Weather w = new com.cdyne.wsf.Weather(); x=w.GetCityWeatherByZIP(zip); retu

我有一个简单的web服务应用程序,它引用了

我在Service1.asmx.cs中的主要功能如下所示:

public com.cdyne.wsf.WeatherReturn HelloWorld( string zip) 
{
    com.cdyne.wsf.WeatherReturn x;
    com.cdyne.wsf.Weather w = new com.cdyne.wsf.Weather();
    x=w.GetCityWeatherByZIP(zip);
    return x;
}
我创建了一个表单,引用了web服务应用程序(引用以“localhost”的名称保存),并调用了functin Hello world:

static void Main()
{
    localhost.Service1 service= new WeatherApplication.localhost.Service1();
    localhost.WeatherReturn a = service.HelloWorld("10001");
    Console.WriteLine(a);

    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    Application.Run(new Form1());
}
代码没有错误,web服务在浏览器中运行并打开,但当我尝试运行表单时,我收到一个错误:

尝试运行项目时出错:

无法启动程序

这里写的是我的项目的位置

调用的对象已与其客户端断开连接

我甚至不知道该尝试什么,我尝试过谷歌搜索错误,但没有找到任何适用于这个确切问题的方法