none
Having problems attaching service reference to ASP.NET IIS Page RRS feed

  • Question

  • I'm trying to attach a IIS WCF service to a ASP.NET IIS Page (MVC 4.0) in Visual Studio 2012

    When attaching the service to non-ASP.NET projects, the service reference works fine.  However as soon as I try to import it into the IIS ASP.NET project, it fails with the following error messages

    Error	20	Custom tool error: Failed to generate code for the service reference 'SysCom'.  Please check other error and warning messages for details.	C:\hub sandbox\Hub Framework 0.01\SystemComponent\WebHandlerSystem\Service References\SysCom\Reference.svcmap	1	1	WebHandlerSystem
    Warning	18	Custom tool warning: Cannot import wsdl:binding
    Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
    XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='ISystemComponentService']
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='WSHttpBinding_ISystemComponentService']	C:\hub sandbox\Hub Framework 0.01\SystemComponent\WebHandlerSystem\Service References\SysCom\Reference.svcmap	1	1	WebHandlerSystem
    Warning	19	Custom tool warning: Cannot import wsdl:port
    Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
    XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='WSHttpBinding_ISystemComponentService']
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='SystemComponentService']/wsdl:port[@name='WSHttpBinding_ISystemComponentService']	C:\hub sandbox\Hub Framework 0.01\SystemComponent\WebHandlerSystem\Service References\SysCom\Reference.svcmap	1	1	WebHandlerSystem
    Warning	17	Custom tool warning: Cannot import wsdl:portType
    Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
    Error: Could not load file or assembly 'DotNetOpenAuth.AspNet, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246' or one of its dependencies. The system cannot find the file specified.
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='ISystemComponentService']	C:\hub sandbox\Hub Framework 0.01\SystemComponent\WebHandlerSystem\Service References\SysCom\Reference.svcmap	1	1	WebHandlerSystem
    Warning	16	The 'packages' element is not declared.	C:\hub sandbox\Hub Framework 0.01\SystemComponent\WebHandlerSystem\packages.config	2	2	WebHandlerSystem

    For those of you who can't read the above, here is a more friendly screen capture:

    And this is my web.config for the WCF Service.

    I am using a wsHttpBinding.  (Before it was basicHttpsBinding and that failed as well)

    <?xml version="1.0"?>
    <configuration>
    
      <appSettings>
        <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
      </appSettings>
      <system.web>
        <compilation debug="true" targetFramework="4.5" />
        <httpRuntime targetFramework="4.5"/>
      </system.web>
      <system.serviceModel>
        <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="true"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <protocolMapping>
            <add binding="wsHttpBinding" scheme="http" />
        </protocolMapping>    
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
      </system.serviceModel>
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
        <!--
            To browse web app root directory during debugging, set the value below to true.
            Set to false before deployment to avoid disclosing web app folder information.
          -->
        <directoryBrowse enabled="true"/>
      </system.webServer>
    
    </configuration>






    • Edited by Donald Hess Wednesday, May 14, 2014 8:50 PM
    Wednesday, May 14, 2014 8:41 PM

Answers

  • Hi,

    >>Customtool error: Failedto generate code forthe service reference 'SysCom'.

    Please try to right click on your service reference and choose Configure Service Reference

    Then uncheck Reuse types in referenced assemblies:

    Reuse Types

    Then click OK, clean and rebuild your solution.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, May 15, 2014 3:27 AM
    Moderator

All replies

  • Hi,

    >>Customtool error: Failedto generate code forthe service reference 'SysCom'.

    Please try to right click on your service reference and choose Configure Service Reference

    Then uncheck Reuse types in referenced assemblies:

    Reuse Types

    Then click OK, clean and rebuild your solution.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, May 15, 2014 3:27 AM
    Moderator
  • Thanks Amy for the solution.

    Just wondering, we did not need to do this before. Just wondering did something change(Any update caused this?).

    Is there a way we avoid this error

    Tuesday, June 17, 2014 4:03 PM