Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/270.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.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# WCF DataServices Astoria版本2从代码调用时不返回结果_C#_Wcf_Wcf Data Services - Fatal编程技术网

C# WCF DataServices Astoria版本2从代码调用时不返回结果

C# WCF DataServices Astoria版本2从代码调用时不返回结果,c#,wcf,wcf-data-services,C#,Wcf,Wcf Data Services,我有WCF数据服务,当直接通过浏览器查询时,它非常有效。然而,当我试图从VisualStudio2010中查询并绑定到网格时,它抛出一个DataServiceQueryException,告诉我“未找到资源”404错误。这真的很奇怪。有什么想法吗?您是否自行主持该服务?测试服务时,您是否在VS dev服务器中运行它 <body bgcolor="white"> <span><H1>Server Error in '/' Application

我有WCF数据服务,当直接通过浏览器查询时,它非常有效。然而,当我试图从VisualStudio2010中查询并绑定到网格时,它抛出一个DataServiceQueryException,告诉我“未找到资源”404错误。这真的很奇怪。有什么想法吗?

您是否自行主持该服务?测试服务时,您是否在VS dev服务器中运行它

<body bgcolor="white">

        <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

        <h2> <i>The resource cannot be found.</i> </h2></span>

        <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

        <b> Description: </b>HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. &nbsp;Please review the following URL and make sure that it is spelled correctly.
        <br><br>

        <b> Requested URL: </b>/TripReport.svc/OPRs<br><br>

        <hr width=100% size=1 color=silver>

        <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

        </font>

</body>

我的想法是,当您尝试添加服务引用时,该服务可能没有实际运行。

这仍然存在问题。服务托管在客户机中。以下是全部错误:

<body bgcolor="white">

        <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

        <h2> <i>The resource cannot be found.</i> </h2></span>

        <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

        <b> Description: </b>HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. &nbsp;Please review the following URL and make sure that it is spelled correctly.
        <br><br>

        <b> Requested URL: </b>/TripReport.svc/OPRs<br><br>

        <hr width=100% size=1 color=silver>

        <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

        </font>

</body>
[数据服务客户端异常: 找不到资源。 正文{字体系列:“Verdana”;字体重量:正常;字体大小:.7em;颜色:黑色;} p{字体系列:“Verdana”;字体大小:正常;颜色:黑色;页边顶部:-5px} {字体系列:“Verdana”;字体大小:粗体;颜色:黑色;页边顶部:-5px} H1{字体系列:“Verdana”;字体重量:正常;字体大小:18pt;颜色:红色} H2{字体系列:“Verdana”;字体重量:正常;字体大小:14pt;颜色:褐红色} 前{字体系列:“Lucida控制台”;字体大小:.9em} .marker{字体大小:粗体;颜色:黑色;文本装饰:无;} .version{color:gray;} .错误{页边距底部:10px;} .expandable{文本装饰:下划线;字体大小:粗体;颜色:海军蓝;光标:手;}

<body bgcolor="white">

        <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

        <h2> <i>The resource cannot be found.</i> </h2></span>

        <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

        <b> Description: </b>HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. &nbsp;Please review the following URL and make sure that it is spelled correctly.
        <br><br>

        <b> Requested URL: </b>/TripReport.svc/OPRs<br><br>

        <hr width=100% size=1 color=silver>

        <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

        </font>

</body>

“/”应用程序中出现服务器错误。
找不到资源。 描述:HTTP 404。您正在查找的资源(或其依赖项之一)可能已被删除、名称已更改或暂时不可用。请查看以下URL并确保其拼写正确。

请求的URL:/TripReport.svc/OPRs

版本信息:Microsoft.NET Framework版本:4.0.30319;ASP.NET版本:4.0.30319.1
] System.Data.Services.Client.QueryResult.Execute()+475306 System.Data.Services.Client.DataServiceRequest.Execute(DataServiceContext上下文,QueryComponents QueryComponents)+137

<body bgcolor="white">

        <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

        <h2> <i>The resource cannot be found.</i> </h2></span>

        <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

        <b> Description: </b>HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. &nbsp;Please review the following URL and make sure that it is spelled correctly.
        <br><br>

        <b> Requested URL: </b>/TripReport.svc/OPRs<br><br>

        <hr width=100% size=1 color=silver>

        <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

        </font>

</body>
[DataServiceQueryException:处理此请求时出错。] System.Data.Services.Client.DataServiceRequest.Execute(DataServiceContext上下文,QueryComponents QueryComponents)+396 System.Data.Services.Client.DataServiceQuery
1.Execute()+77
System.Data.Services.Client.DataServiceQuery
1.GetEnumerator()+13 System.Collections.Generic.List
1..ctor(IEnumerable
1 collection)+315 System.Linq.Enumerable.ToList(IEnumerable`1源)+58 C:\Users\administrator\Documents\Visual Studio 2010\Projects\TripReport\Common\Controller\GeneralController.GetDirectors()中的TripReport.Controllers.GeneralController.GetDirectors() 在C:\Users\administrator\Documents\Visual Studio 2010\Projects\TripReport\Controls\CreateTrip.Page\中加载(对象发送方,事件参数e):16 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp,对象o,对象t,事件参数e)+14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(对象发送方,EventArgs e)+35 System.Web.UI.Control.OnLoad(EventArgs e)+91 System.Web.UI.Control.LoadRecursive()+74 System.Web.UI.Control.LoadRecursive()+146 System.Web.UI.Control.LoadRecursive()+146 System.Web.UI.Control.LoadRecursive()+146 System.Web.UI.Control.LoadRecursive()+146 System.Web.UI.Control.LoadRecursive()+146 System.Web.UI.Control.LoadRecursive()+146 System.Web.UI.Control.LoadRecursive()+146
System.Web.UI.Page.ProcessRequestMain(布尔includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoint)+2207

@sv88erik,我不明白。“查找VS所有函数”是什么意思?服务(.svc文件)位于主客户端应用程序中,但服务代码位于类库中。我想了想你说的话,但是在VSI中无法与客户端一起启动类库我不知道我是否在正确的轨道上,但是在VS中可以同时启动2个以上的项目。一旦第一个应用程序运行,右键单击第二个项目并选择“调试>启动新实例”
<body bgcolor="white">

        <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

        <h2> <i>The resource cannot be found.</i> </h2></span>

        <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

        <b> Description: </b>HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. &nbsp;Please review the following URL and make sure that it is spelled correctly.
        <br><br>

        <b> Requested URL: </b>/TripReport.svc/OPRs<br><br>

        <hr width=100% size=1 color=silver>

        <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

        </font>

</body>