简体   繁体   中英

Cannot open svc file with wcfTestClient.exe

I just added wcf service to my website. web.config look like this:

<system.serviceModel>
<services>
  <service name="Realstuf.Service">

    <host>
      <baseAddresses>
        <add baseAddress = "http://ismyrealstuff/Services/" />
      </baseAddresses>
    </host>

    <!-- Service Endpoints -->
    <endpoint address ="http://ismyrealstuff/Services/Service.svc" binding="wsHttpBinding" contract="Realstuf.IService" behaviorConfiguration="FirstServiceBehaviour"/>

    <!-- Metadata Endpoints -->
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>
    <behaviors>
        <serviceBehaviors>
            <behavior name="FirstServiceBehaviour">
                <serviceMetadata httpGetEnabled="true" />
                <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>

A svc file is added and service.cs and Iservice.cs files are added in app_code directory. No Assemblyinfo.cs file is found.

When I tried to open svc file in wcftestclient "Failed to add service" error has generated. The Error detail says:

Error: Cannot read D:\\Projects\\IsMyRealStuf\\IsMyRealStuffWeb\\Services\\Service.svc. Cannot load file D:\\Projects\\IsMyRealStuf\\IsMyRealStuffWeb\\Services\\Service.svc as an Assembly. Check the FusionLogs for more Information. Could not load file or assembly 'file:///D:\\Projects\\IsMyRealStuf\\IsMyRealStuffWeb\\Services\\Service.svc' or one of its dependencies. The module was expected to contain an assembly manifest.

If I add any assemblyinfo.cs file is it solution for this? then How ?

http://ismyrealstuff/Services/Service.svc添加为服务,而不是磁盘上的文件。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM