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

Run ReportService as a Windows service?

3 Answers 96 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
FposUser
Top achievements
Rank 1
FposUser asked on 23 Dec 2009, 02:35 PM
I attempted to create a Windows service to host the Telerik.Reporting.Service.ReportService. Everything seemed to work fine until I tried to start the service, and received this error:

"Service cannot be started. System.InvalidOperationException: This service requires ASP.NET compatibility and must be hosted in IIS.  Either host the service in IIS with ASP.NET compatibility turned on in web.config or set the AspNetCompatibilityRequirementsAttribute.AspNetCompatibilityRequirementsMode property to a value other than Required."

Can we please have a build that does not require IIS/AspNetCompatibility? I am building a Silverlight application, so the ASPX compatibility is not important for me. We were thrilled to see the Silverlight report viewer, thinking we could eliminate IIS as a requirement. This is the final obstacle that must be resolved to use Telerik Reporting in our application.

Regards,
Brian

3 Answers, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 29 Dec 2009, 09:47 AM
Hello Brian,

The AspNetCompatibilityRequirementsAttribute attribute in our Silverlight service is there for a reason. The service utilizes essential parts of ASP.NET and IIS in this regard, so removing this requirement is not an option at the present moment, I am afraid.

Happy Holidays!

Best wishes,
Ivan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Damian Slee
Top achievements
Rank 1
answered on 10 May 2010, 01:46 PM
you can inherit from ReportServiceBase as this is where the service contract is.   ReportService seems to just to use the ASP.Net Session to save state.    If you just inherity from ReportServiceBase, it saves the state in a internal static dictionary.

I've done this and it seems to work.   I also had to manually load the report library assembly, so ReportServiceBase will find it with reflection.
var reportLibrary = Assembly.Load("ReportLibrary");

    public class CustomReportService : ReportServiceBase  
    {  
        protected override Uri BaseAddress  
        {  
            get 
            {  
                return new Uri("http://localhost/myservice/CustomReportService.svc", UriKind.RelativeOrAbsolute);  
            }  
        }  
    } 
0
Damian Slee
Top achievements
Rank 1
answered on 10 May 2010, 01:57 PM


also the WCF config changed for windows service hosting.    Change the service name to the new class name, and add the <baseAddresses> bit.

 <service name="mynamespace.CustomReportService" 
               behaviorConfiguration="ReportServiceBehavior">  
        <host> 
          <baseAddresses> 
            <add baseAddress="http://localhost/myservice/ReportService.svc" /> 
          </baseAddresses> 
        </host> 
 
        <endpoint address="" 
                  binding="basicHttpBinding" 
                  contract="Telerik.Reporting.Service.IReportService">  
        </endpoint> 
 
        <endpoint address="resources" 
                  binding="webHttpBinding" 
                  behaviorConfiguration="WebBehavior" 
                  contract="Telerik.Reporting.Service.IResourceService"/>  
 
        <endpoint address="mex" 
                  binding="mexHttpBinding" 
                  contract="IMetadataExchange" /> 
      </service> 
Tags
General Discussions
Asked by
FposUser
Top achievements
Rank 1
Answers by
Ivan
Telerik team
Damian Slee
Top achievements
Rank 1
Share this question
or