WCF Data Service

2 posts, 1 answers
  1. JiFong Chen
    JiFong Chen avatar
    13 posts
    Member since:
    Aug 2007

    Posted 01 Jul 2013 Link to this post

    I have generated WCF Data Service from OpenAccess Service Wizard and I can browse http://localhost:15241/EntitiesModelService.svc when I run the project under VS2012.

    When I deploy to the remote IIS server, I can't browse to it and it gave me the following error:

    Exception information:
        Exception type: InvalidOperationException
        Exception message: The type 'WCFDataService.EntitiesModelService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.
       at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)
       at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
       at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity)
       at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)

    My Web.config:
    <?xml version="1.0"?>
    <!--
      For more information on how to configure your ASP.NET application, please visit
      http://go.microsoft.com/fwlink/?LinkId=169433
      -->
    <configuration>
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"></modules>
      </system.webServer>
      <system.web>
        <compilation debug="true" targetFramework="4.5" />
        <httpRuntime targetFramework="4.5" />
      </system.web>
      <connectionStrings>
        <add name="SqlConnection" connectionString="data source=****;initial catalog=****;persist security info=True;user id=****;password=****" providerName="System.Data.SqlClient" />
      </connectionStrings>
      <system.serviceModel>
        <behaviors>
          <serviceBehaviors>
            <behavior name="">
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
      </system.serviceModel>
    </configuration>
  2. Answer
    Yordan
    Admin
    Yordan avatar
    39 posts

    Posted 03 Jul 2013 Link to this post

    Hello JiFong,

    Since the WCF project is working fine in Visual Studio there should be an issue with the deployment process. Particularly this error might occur if the assembly of your WCF project is not deployed to the bin folder where the application is deployed. Please make sure that all the required assemblies are located in the bin folder of the deployment directory.

    If the suggested resolution doesn't help in your scenario or if something else is causing exceptions do not hesitate to contact us again for assistance.
     
    Regards,
    Yordan
    Telerik
    OpenAccess ORM Q2 2013 brings you a more powerful code generation and a unique Bulk Operations support with LINQ syntax. Check out the list of new functionality and improvements shipped with this release.
  3. DevCraft banner
Back to Top