HTTP Error 404.17 - Not Found
<p>IN VS 2008 i can run .svc but on production IIS 7 i can't. I get this error. i am using x64 win.</p>

<p>I run</p>

<pre><code>C:\Windows\Microsoft.NET\Framework\v2.5.0.30319&gt;aspnet_regiis.exe -i
Start installing ASP.NET (4.0.30319).
.........................
</code></pre>

<p>and</p>

<pre><code>C:\Windows\Microsoft.NET\Framework\v2.0.50727&gt;aspnet_regiis.exe -i
The error indicates that IIS is not installed on the machine. Please install IIS
Finished installing ASP.NET (2.0.50727).
</code></pre>

<p>but it is the same. I run VS 2008. Application pool :NET framweork is 2.0. And i enable 32 bit application</p>

<pre><code>    Error Summary
HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.
Detailed Error Information
Module  StaticFileModule
Notification    ExecuteRequestHandler
Handler StaticFile
Error Code  0x80070032
Requested URL   http://192.168.2.4:80/Service.svc
Physical Path   C:\inetpub\wwwroot\WebServices\Service.svc
Logon Method    Anonymous
Logon User  Anonymous
Most likely causes:

    The request matched a wildcard mime map. The request is mapped to the static file handler. If there were different pre-conditions, the request will map to a different handler.

Things you can try:

    If you want to serve this content as a static file, add an explicit MIME map.
</code></pre>

<p>EDIT:</p>

<p>web.config</p>

<pre><code>&lt;?xml version="1.0"?&gt;

&lt;!--
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website-&gt;Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
--&gt;
&lt;configuration&gt;
    &lt;configSections&gt;
        &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /&gt;
        &lt;section name="nhibernateSettings" type="ProjectBase.Data.NHibernateSessionMgmt.OpenSessionInViewSection, ProjectBase.Data" /&gt;
        &lt;sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"&gt;
            &lt;sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"&gt;
                &lt;section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /&gt;
                &lt;sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"&gt;
                    &lt;section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" /&gt;
                    &lt;section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /&gt;
                    &lt;section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /&gt;
                    &lt;section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /&gt;
                &lt;/sectionGroup&gt;
            &lt;/sectionGroup&gt;
        &lt;/sectionGroup&gt;
    &lt;/configSections&gt;
    &lt;appSettings&gt;
        &lt;add key="NHibernateConfigPath" value="D:\PROJEKTI\WebServices\DotNet\WebServices\WebServices\NHibernate.config" /&gt;
    &lt;/appSettings&gt;
    &lt;connectionStrings&gt;
        &lt;add name="connectionString" connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=WebServices;Data Source=.\SQL2008" providerName="System.Data.SqlClient" /&gt;
    &lt;/connectionStrings&gt;
    &lt;nhibernateSettings&gt;
        &lt;!-- List every session factory that will be needed; transaction management and closing sessions 
          will be managed with the open-session-in-view module --&gt;
        &lt;sessionFactories&gt;
            &lt;clearFactories /&gt;
            &lt;sessionFactory name="WebCrawlerFactory" factoryConfigPath="D:\PROJEKTI\WebServices\DotNet\WebServices\WebServices\NHibernate.config" isTransactional="true" /&gt;
        &lt;/sessionFactories&gt;
    &lt;/nhibernateSettings&gt;
    &lt;log4net&gt;
        &lt;appender name="LogAllToFile" type="log4net.Appender.FileAppender"&gt;
            &lt;file value="WebCrawler.log" /&gt;
            &lt;appendToFile value="false" /&gt;
            &lt;layout type="log4net.Layout.PatternLayout"&gt;
                &lt;conversionPattern value="%d [%t] %-5l - %m%n%n" /&gt;
            &lt;/layout&gt;
        &lt;/appender&gt;
        &lt;root&gt;
            &lt;priority value="ALL" /&gt;
            &lt;!-- ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF--&gt;
            &lt;appender-ref ref="LogAllToFile" /&gt;
        &lt;/root&gt;
    &lt;/log4net&gt;
    &lt;system.web&gt;
        &lt;!--
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        --&gt;
        &lt;compilation debug="true"&gt;
            &lt;assemblies&gt;
                &lt;add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /&gt;
                &lt;add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
            &lt;/assemblies&gt;
        &lt;/compilation&gt;
        &lt;!--
            The &lt;authentication&gt; section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        --&gt;
        &lt;authentication mode="Windows" /&gt;
        &lt;!--
            The &lt;customErrors&gt; section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.

        &lt;customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"&gt;
            &lt;error statusCode="403" redirect="NoAccess.htm" /&gt;
            &lt;error statusCode="404" redirect="FileNotFound.htm" /&gt;
        &lt;/customErrors&gt;
        --&gt;
        &lt;pages&gt;
            &lt;controls&gt;
                &lt;add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
            &lt;/controls&gt;
        &lt;/pages&gt;
        &lt;httpHandlers&gt;
            &lt;remove verb="*" path="*.asmx" /&gt;
            &lt;add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
            &lt;add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
            &lt;add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" /&gt;
        &lt;/httpHandlers&gt;
        &lt;httpModules&gt;
            &lt;add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
        &lt;/httpModules&gt;
    &lt;/system.web&gt;
    &lt;system.codedom&gt;
        &lt;compilers&gt;
            &lt;compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"&gt;
                &lt;providerOption name="CompilerVersion" value="v3.5" /&gt;
                &lt;providerOption name="WarnAsError" value="false" /&gt;
            &lt;/compiler&gt;
        &lt;/compilers&gt;
    &lt;/system.codedom&gt;
    &lt;system.web.extensions&gt;
        &lt;scripting&gt;
            &lt;webServices&gt;
                &lt;!--
              Uncomment this section to enable the authentication service. Include 
              requireSSL="true" if appropriate.

          &lt;authenticationService enabled="true" requireSSL = "true|false"/&gt;
          --&gt;
                &lt;!--
              Uncomment these lines to enable the profile service, and to choose the 
              profile properties that can be retrieved and modified in ASP.NET AJAX 
              applications.

          &lt;profileService enabled="true"
                          readAccessProperties="propertyname1,propertyname2"
                          writeAccessProperties="propertyname1,propertyname2" /&gt;
          --&gt;
                &lt;!--
              Uncomment this section to enable the role service.

          &lt;roleService enabled="true"/&gt;
          --&gt;
            &lt;/webServices&gt;
            &lt;!--
        &lt;scriptResourceHandler enableCompression="true" enableCaching="true" /&gt;
        --&gt;
        &lt;/scripting&gt;
    &lt;/system.web.extensions&gt;
    &lt;!--
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    --&gt;
    &lt;system.webServer&gt;
        &lt;validation validateIntegratedModeConfiguration="false" /&gt;
        &lt;modules&gt;
            &lt;add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
        &lt;/modules&gt;
        &lt;handlers&gt;
            &lt;remove name="WebServiceHandlerFactory-Integrated" /&gt;
            &lt;add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
            &lt;add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
            &lt;add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
        &lt;/handlers&gt;
    &lt;/system.webServer&gt;
    &lt;system.serviceModel&gt;
        &lt;services&gt;
            &lt;service name="WebServices.Service" behaviorConfiguration="WebServices.ServiceBehavior"&gt;
                &lt;!-- Service Endpoints --&gt;
                &lt;endpoint address="" binding="wsHttpBinding" contract="WebServices.IService"&gt;
                    &lt;!-- 
              Upon deployment, the following identity element should be removed or replaced to reflect the 
              identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
              automatically.
          --&gt;
                    &lt;identity&gt;
                        &lt;dns value="localhost" /&gt;
                    &lt;/identity&gt;
                &lt;/endpoint&gt;
                &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
            &lt;/service&gt;
        &lt;/services&gt;
        &lt;behaviors&gt;
            &lt;serviceBehaviors&gt;
                &lt;behavior name="WebServices.ServiceBehavior"&gt;
                    &lt;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&gt;
                    &lt;serviceMetadata httpGetEnabled="true" /&gt;
                    &lt;!-- 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 --&gt;
                    &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt;
                &lt;/behavior&gt;
            &lt;/serviceBehaviors&gt;
        &lt;/behaviors&gt;
    &lt;/system.serviceModel&gt;
&lt;/configuration&gt;
</code></pre>
