I created a restful web service in WCF. Everything works perfectly fine if i host it via IISExpress in Visual Studio. But after deploying it to local IIS, a 404.17 NOT FOUND error occures, when trying to access the .svc service. It states: "Not Found The requested content appears to be script and will not be served by the static file handler"
I already tried these solutions:
Launch Command Prompt - Start - cmd.exe cd C:\Windows\Microsoft.NET\Framework64[Dot Net Version] aspnet_regiis -ir and "C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation" and execute"servicemodelreg -i" to install them manually.
which did not change anything.
I'm pretty sure it's a configuration problem but can't figure it out since I'm quite unexperienced in doing this.
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</configSections>
<appSettings/>
<system.web>
<compilation debug="true" targetFramework="4.6.2"/>
<httpRuntime/>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="webHttpServiceBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="MyService.Service" behaviorConfiguration="ServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost/"/>
</baseAddresses>
</host>
<endpoint binding="webHttpBinding" contract="MyService.IMyService" behaviorConfiguration="webHttpServiceBehavior"/>
</service>
</services>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="true"/>
</system.webServer>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb"/>
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
</providers>
</entityFramework>
<connectionStrings>
<add name="MyEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=localhost\myDB;initial catalog=DB;integrated security=True;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient"/>
</connectionStrings>
</configuration>
I'm pretty frustrated after trying for days because developing this service was real fun until deployment failed completely. I would really appreciate any hints. Thanks!