locked
VS 2013 WCF Service Library missing RRS feed

  • Question

  • User217028333 posted

    Quick question

    I am doing a Plural Sight tutorial on WCF and they are using the WCF Service Library (as opposed to application.)

    When I go to Add new project there is no WCF Service Library. Not under any of the .NET versions.

    I am using Visual Studio 2013 for Web Express.

    Any one know how I can get it?

    Thanks

    Wednesday, May 28, 2014 12:46 PM

Answers

  • User-1454326058 posted

    Hi dariune,

    I checked my Visual Studio 2013 Express for web, I found there isn’t the WCF library project. (I also have VS2013 Ultimate, it has the WCF library project).

    So, the WCF service library is not in Visual Studio 2013 Express for Web.

    However we could do some changes to achieve the WCF library project.

    1. Create a WCF Service Application
    2. Copy the Code that in the .svc file (E.g. Service1.svc)
    3. Delete .svc file (E.g. Service1.svc)
    4. Create a new class file (E.g. Service1)
    5. Parse the copied code to the Service1.cs (If you are using the different class name, you should modify the parsed code)
    6. Change Web.config to App.config
    7. Base on this code below to replace your App.config code (system.serviceModel)
    <system.serviceModel>
        <services>
          <service name="WcfServiceLibrary1.Service1">
            <host>
              <baseAddresses>
                <add baseAddress = "http://localhost:8733/Design_Time_Addresses/WcfServiceLibrary1/Service1/" />
              </baseAddresses>
            </host>
            <!-- Service Endpoints -->
            <!-- Unless fully qualified, address is relative to base address supplied above -->
            <endpoint address="" binding="basicHttpBinding" contract="WcfServiceLibrary1.IService1">
              <!-- 
                  Upon deployment, the following identity element should be removed or replaced to reflect the 
                  identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
                  automatically.
              -->
              <identity>
                <dns value="localhost"/>
              </identity>
            </endpoint>
            <!-- Metadata Endpoints -->
            <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. --> 
            <!-- This endpoint does not use a secure binding and should be secured or removed before deployment -->
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior>
              <!-- To avoid disclosing metadata information, 
              set the values below to false before deployment -->
              <serviceMetadata httpGetEnabled="True" httpsGetEnabled="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>

    Thanks

    Best Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 29, 2014 5:44 AM

All replies

  • User-1366948256 posted

    I think its a express version limitation. Check other versions.

    Thursday, May 29, 2014 3:10 AM
  • User-1454326058 posted

    Hi dariune,

    I checked my Visual Studio 2013 Express for web, I found there isn’t the WCF library project. (I also have VS2013 Ultimate, it has the WCF library project).

    So, the WCF service library is not in Visual Studio 2013 Express for Web.

    However we could do some changes to achieve the WCF library project.

    1. Create a WCF Service Application
    2. Copy the Code that in the .svc file (E.g. Service1.svc)
    3. Delete .svc file (E.g. Service1.svc)
    4. Create a new class file (E.g. Service1)
    5. Parse the copied code to the Service1.cs (If you are using the different class name, you should modify the parsed code)
    6. Change Web.config to App.config
    7. Base on this code below to replace your App.config code (system.serviceModel)
    <system.serviceModel>
        <services>
          <service name="WcfServiceLibrary1.Service1">
            <host>
              <baseAddresses>
                <add baseAddress = "http://localhost:8733/Design_Time_Addresses/WcfServiceLibrary1/Service1/" />
              </baseAddresses>
            </host>
            <!-- Service Endpoints -->
            <!-- Unless fully qualified, address is relative to base address supplied above -->
            <endpoint address="" binding="basicHttpBinding" contract="WcfServiceLibrary1.IService1">
              <!-- 
                  Upon deployment, the following identity element should be removed or replaced to reflect the 
                  identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
                  automatically.
              -->
              <identity>
                <dns value="localhost"/>
              </identity>
            </endpoint>
            <!-- Metadata Endpoints -->
            <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. --> 
            <!-- This endpoint does not use a secure binding and should be secured or removed before deployment -->
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior>
              <!-- To avoid disclosing metadata information, 
              set the values below to false before deployment -->
              <serviceMetadata httpGetEnabled="True" httpsGetEnabled="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>

    Thanks

    Best Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 29, 2014 5:44 AM