2010-12-07 7 views
0

私はWCF DataServiceを持っています。しかし、Visual Studio 2010から実行してグリッドにクエリしてバインドしようとすると、「リソースが見つかりません」という404エラーが発生しているとDataServiceQueryExceptionがスローされます。これは本当に奇妙です。何かご意見は?WCF DataServices Astoriaバージョン2がコードから呼び出されたときに結果を返さない

+0

すべての関数をVSで検索しますか? – sv88erik

+0

@ sv88erik、私は分かりません。 「あなたのすべての機能をVSで検索しますか? ? – Ryan

答えて

0

サービスをご自身でホストしていますか?サービスをテストするときはVS devサーバーで実行していますか?

サービス参照を追加しようとすると、実際にはサービスが実行されていない可能性があります。

+0

サービス(.svcファイル)はメインのクライアントAPPにありますが、サービスコードはクラスライブラリにあります。私はあなたが言ったことを考えましたが、VSでクライアントがクラスライブラリを起動することはできません – Ryan

+0

私は正しい軌道にいるかどうかわかりませんが、VSで同時に2つ以上のプロジェクトを開始することができます。最初のアプリケーションが起動したら、2番目のプロジェクトを右クリックし、[デバッグ]> [新しいインスタンスの開始]を選択します。 – Doobi

0

これはまだ問題があります。サービスはクライアントでホストされます。ここに完全なエラーがあります:

[DataServiceClientException: リソースが見つかりません。 body {font-family: "Verdana"; font-weight:normal; font-size:.7em; color:black;} p {font-family: "Verdana"; font-weight:normal; color:black ; margin-top:-5px} b {font-family: "Verdana"; font-weight:bold; color:black; margin-top:-5px}H1 {font-family: "Verdana"; font-weight :normal; font-size:18pt; color:red} H2 {font-family: "Verdana"; font-weight:normal;フォントサイズ:14pt;色:maroon} pre {font-family: "Lucida Console "; font-size:.9em} .marker {font-weight:bold;色:黒;テキスト装飾:なし;} .version {color:gray;} .error {margin-bottom:10px;} .expandable {text-decoration:underline; font-weight:太字;色:ネイビー;カーソル:手; }

<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> 

] System.Data.Services.Client.QueryResult.Execute()475306 System.Data.Services.Client.DataServiceRequest.Execute(たDataServiceContextコンテキスト、QueryComponentsのqueryComponents)137

[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コレクション)315 System.Linq.Enumerable.ToList(IEnumerable`1源)+58 TripReport.Controllers.GeneralControllers.GetDirectorates()Cで:\ Users \ administrator \ Documents \ Visual Studio 2010 \ Projects \ TripReport \ Common \ Controllers \ GeneralControllers.cs:14 C:\ Users \ administrator \ Documents \にあるTripReport.Controls.CreateTrip.Page_Load(オブジェクト送信者、EventArgs e) Visual Studio 2010 \ Projects \ TripReport \ Controls \ CreateTrip.ascx.cs:16 System.Web.Util.CalliHelper.EventArgFunctionCaller(intPtr fp、Object o、Object t、EventArgs e)+14 System.Web.Util.CalliEventHandlerDelegateProxy .Callback(Object sender、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 システム.Web.UI.Control.LoadRecursive()+146 System.Web.UI.Page。ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint、Boolean includeStagesAfterAsyncPoint)+2207

関連する問題