をしようとしたときに見つかりません - が見つかりませんでした あなたが探しているリソースが削除されているが、その名前が変更された、または現在利用でき。HTTPエラー404.0 - 私はこの</p> <p>HTTPエラー404.0取得していますローカルWCFにアクセスするために
私のブラウザからサービスにアクセスしようとしています。ここに私の設定です。
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<!-- Note: the service name must match the configuration name for the service implementation. -->
<service name="WcfServiceLibrary.Service1" behaviorConfiguration="MyServiceTypeBehaviors" >
<!-- Add the following endpoint. -->
<!-- Note: your service must have an http base address to add this endpoint. -->
<endpoint contract="WcfServiceLibrary.Service1" binding="basicHttpBinding" address="http://localhost/service1" />
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="http://localhost/service1/mex" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceTypeBehaviors" >
<!-- Add the following element to your service behavior configuration. -->
<serviceMetadata httpGetEnabled="true" httpGetUrl="http://localhost/service1" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
私は、Webブラウザでhttp://localhost/service1を入力すると、私は404を得る。しかし、私は下のApp.configファイルを削除し、ちょうどsimpley
string serviceUrl = "http://localhost/service1";
Uri uri = new Uri(serviceUrl);
host = new ServiceHost(typeof(Service1), uri);
host.Open();
の背後にあるコードでこれを行う場合は、すべてがうまく機能します.. 。 何か案は?シンプルだと思われる。
IISまたはSelfでこれをホストしようとしていますか? – Martin
セルフホスト。私はWindowsフォームアプリケーション – stack
を作成しました。 – stack