asp.net - WCF Service works in VS debug mode, not when published to IIS -


I have a site that includes the WCF service (AJAX enabled). Everything works when Visual Studio launches in debug mode when I publish the site on the IIS server, the WCF service is not available. I get a 404 error in trying to load the javascript file created by the web service.

Back to my web service file, the beginning of my code, SqlAjax.cs:

  using the system; Using System.Collections.Generic; Using System.Linq; Use the system. time. Timeliness; Using System.ServiceModel; Using System.ServiceModel.Activation; Using System.ServiceModel.Web; Using System.Text; Using System.Data.SqlClient; Using System.configuration; Using System.Web.Script.Serialization; [ServiceContract (namespace = "")] [AspNetCompatibilityRequirements (RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] Public class SqlAjax {  

My Web Configured:

  & lt;? Xml version = "1.0"? & Gt; & Lt ;! - For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=169433- & gt; & Lt; Configuration & gt; & Lt; system.webServer & gt; & Lt; Validation valid integrated integrated configuration = "false" /> & Lt; /system.webServer> & Lt; ConnectionStrings & gt; & Lt; / ConnectionStrings & gt; & Lt; System.web & gt; & Lt; Compilation debug = "true" targetFramework = "4.5.1" & gt; & Lt; Assemblies & gt; & Lt; Add Assembly = "System.Windows.Forms, Version = 4.0.0.0, Culture = Neutral, PublicKeyToken = B77A5C561934E089" /> & Lt; Add assembly = "System.Web.DataVisualization, version = 4.0.0.0, culture = neutral, public token = 31BF3856AD364E35" /> & Lt; / Assemblies & gt; & Lt; / Compilation & gt; & Lt; HttpRuntime targetFramework = "4.5.1" /> & Lt; /system.web> & Lt; System.serviceModel & gt; & Lt; Behavior & gt; & Lt; Endpoint beehaviors & gt; & Lt; Transaction name = "SqlAjaxAspNetAjaxBehavior" & gt; & Lt; EnableWebScript / & gt; & Lt; / Behavior & gt; & Lt; / EndpointBehaviors & gt; & Lt; / Behavior & gt; & Lt; Service Hosting Environment ASPnet Compatibility Enabled = "True" Multiple SiteBindingsEnabled = "true" /> & Lt; Services & gt; & Lt; Service name = "SqlAjax" & gt; & Lt; Endpoint address = "behavior" configuration = "SqlAjaxAspNetAjaxBehavior" binding = "web HTBeding" contract = "SKLegax" /> & Lt; / Services & gt; & Lt; / Services & gt; & Lt; /system.serviceModel> & Lt; / Configuration & gt;   

I have included in my default.aspx:

  & asp: ScriptManager id = "ScriptManager1" runat = "server" EnableCdn = "True" & gt; & Lt; Script & gt; & Lt; Asp: ScriptReference path = "~ / scripts / jquery-2.1.1.min.js" /> & Lt; Asp: ScriptReference path = "~ / scripts / jquery-ui.min-1.11.1.js" /> & Lt; / Script & gt; & Lt; Services & gt; & Lt; Asp: ServiceReference path = "~ / WebServices / SqlAjax.svc" /> & Lt; / Services & gt; & Lt; / ASP: ScriptManager & gt;   

When using Visual Studio 2013, when I run the site in debug mode, the page source includes:

  & lt; Script src = "WebServices / SqlAjax.svc / jsdebug" type = "text / javascript" & gt; & Lt; / Script & gt;   

I can browse that file and it contains functions added to the service.

If I publish the site on the IIS 8.5 server, the page source includes:

    

However, it returns a 404 error.

I was able to find solutions I need to enable WCF services features in Windows features The default installation for 4/5 was unchecked.

Enter image details here

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -