C# 将带有WCF库的web应用程序从Visual Studio dev移动到IIS

C# 将带有WCF库的web应用程序从Visual Studio dev移动到IIS,c#,iis,wcf-binding,C#,Iis,Wcf Binding,我有一个包含WCF库的web应用程序。web应用程序在端口64697上运行,WCF在端口50128上运行。通过运行VS 2010进行测试时,我可以转到localhost:50128/eshop.svc并查看svc页面。 我需要做什么才能将项目发布到IIS开发服务器?IIS被设置为运行WCF,因为我已经在其上放置了测试服务,并且可以访问wsdl。我在wcf库中有一个eshopServive.svc。库名称为“company.EShop.WCF” 谢谢 Web配置代码段 <services&g

我有一个包含WCF库的web应用程序。web应用程序在端口64697上运行,WCF在端口50128上运行。通过运行VS 2010进行测试时,我可以转到localhost:50128/eshop.svc并查看svc页面。 我需要做什么才能将项目发布到IIS开发服务器?IIS被设置为运行WCF,因为我已经在其上放置了测试服务,并且可以访问wsdl。我在wcf库中有一个eshopServive.svc。库名称为“company.EShop.WCF”

谢谢

Web配置代码段

<services>
      <!-- Note: the service name must match the configuration name for the service implementation. -->
      <service name="company.eShop.Wcf.eShopWCFService"
               behaviorConfiguration="MyServiceTypeBehaviors" >
        <endpoint address="" binding="basicHttpBinding"
                  contract="Nad.CheckoutVendor.Interfaces.ICheckoutVendorService">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
      </service>
   </services>
 <bindings>
     <basicHttpBinding>
       <binding name="BasicHttpBinding_ICheckoutVendorService" closeTimeout="00:01:00"
         openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
         allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
         maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
      messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
      useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
           <transport clientCredentialType="None" proxyCredentialType="None"
          realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
         </security>
       </binding>
     </basicHttpBinding>
   </bindings>

我通常将服务编译成DLL,然后在服务器上对其进行GAC。确保IIS下的.svc文件引用GAC的DLL,如下所示:

<%@ Assembly Name="DLLName, Version=1.1.0.0, Culture=neutral, PublicKeyToken=YOURKEY" %>
<%@ ServiceHost Service="DLLNAME.CLASSNAME" %>


这是否意味着我需要将svc文件移到网站的根目录中?您应该能够将svc文件放在您希望的任何位置。