This is a migrated thread and some comments may be shown as answers.

WCF Data Service

1 Answer 121 Views
Web Services
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
JiFong Chen
Top achievements
Rank 1
JiFong Chen asked on 02 Jul 2013, 12:42 AM
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>

1 Answer, 1 is accepted

Sort by
0
Accepted
Yordan
Telerik team
answered on 03 Jul 2013, 02:35 PM
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.
Tags
Web Services
Asked by
JiFong Chen
Top achievements
Rank 1
Answers by
Yordan
Telerik team
Share this question
or