I have a problem here that is really annoying...
I created a WCF servcice with 3 simple methods. The service is running fine localy, on the developing server and on production server.
2 weeks later, I was asked to add some more functionality, so I opened the solution, and tried to build/debug the service BEFORE MAKING ANY CHANGES, to check its state.
Unfortunately, after trying 7-8 different solutions I found on the web, still cannot debug it and I am getting the same error all the time.
Error: Cannot obtain Metadata from http://localhost:50930/StService.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.
WS-Metadata Exchange Error URI: http://localhost:50930/StService.svc Metadata contains a reference that cannot be resolved: 'http://localhost:50930/StService.svc'. Content Type application/soap+xml; charset=utf-8 was not supported by service http://localhost:50930/StService.svc.
The client and service bindings may be mismatched. The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'..
HTTP GET Error URI: http://localhost:50930/StService.svc There was an error downloading 'http://localhost:50930/StService.svc'. The request failed with HTTP status 400: Bad Request.
I tried to edit the web.config (although on both dev & live servsers is the same except DB connections), gave permissions on every Temp Folder, on the project folder, disabled and removed any firewall or antivirus, etc. Can't make it work...
Any ideas?
Here is the web.config as per request:
<?xml version="1.0"?>
<configuration>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
<caching>
<sqlCacheDependency enabled="true">
<databases>
<add connectionStringName="PhotosSqlServer" name="PhotosSqlServer" pollTime="1000"/>
</databases>
</sqlCacheDependency>
</caching>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<!-- 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 -->
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name ="wsMessage">
<security mode ="Message">
<message clientCredentialType ="Windows"/>
</security>
</binding>
</wsHttpBinding>
<netTcpBinding>
<binding name="NetTcpBinding_IStService" maxReceivedMessageSize="5242880" maxConnections="10">
<readerQuotas maxDepth="64" maxStringContentLength="5242880" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="None"></security>
</binding>
</netTcpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="false"/>
</system.webServer>
</configuration>
<serviceDebug includeExceptionDetailInFaults="true" />? - Pablo Claus