C# 如何在IIS问题中托管Wcf服务?

C# 如何在IIS问题中托管Wcf服务?,c#,asp.net,wcf,visual-studio-2010,C#,Asp.net,Wcf,Visual Studio 2010,我读了更多的文章,但我可以在IIS中托管wcf服务 <?xml version="1.0" encoding="utf-8"?> <configuration> <system.web> <compilation debug="true" /> </system.web> <!-- When deploying the service library project, the conte

我读了更多的文章,但我可以在IIS中托管wcf服务


<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.web>
    <compilation debug="true" />
  </system.web>
  <!-- When deploying the service library project, the content of the config file must be added to the host's 
  app.config file. System.Configuration does not support config files for libraries. -->
  <system.serviceModel>
    <services>
      <service name="WcfSrv.MyProject.GetTables.ServiceCrm">
        <endpoint address="" binding="wsHttpBinding" contract="WcfSrv.MyTechnic.GetTables.IService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8732/Design_Time_Addresses/WcfSrv.MyProject.GetTables/ServiceTest/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, 
          set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="True" />
          <!-- To receive exception details in faults for debugging purposes, 
          set the value below to true.  Set to false before deployment 
          to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="False" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

</configuration>

我试图托管我的Wcf服务192.168.0.218我添加了Srv文件和dll新的虚拟目录,但我不能使用Wcf服务。如何使它?我更改了配置文件…

IIS中承载的WCF服务在IIS应用程序中表示为特殊内容文件(.svc文件)。请参阅IIS中的托管WCF服务部分如何使用它以及如何托管WCF服务。

您是否已使用
aspnet\u regiis-i在IIS上(重新)安装了基本asp集成
(
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet\u regiis-i


由于您没有指定确切的错误,因此很难提供帮助,但svc文件需要绑定到IIS中,重新运行上述语句通常可以解决该问题。

iSeries看起来像什么?您是否收到任何特定错误?请检查您的端点specify@Reniuz:否:(………..)我移动了我的评论以回答。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Data.Objects;

namespace WcfSrv.MyProject.GetTables
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in both code and config file together.
    public class ServiceTest : IService
    {
        public List GetAllData(string CustomerName)
        {
            using (CrmEntities crmCtx = new CrmEntities())
            {
                return crmCtx.GetAllDataCustomer(CustomerName).ToList();
            }

        }


    }
}