I have a WCF issuer service using Microsoft.IdentityModel (WIF 3.5), which I need to upgrade to System.IdentityModel (.NET 4.5). The problem is that I cannot change the original name of the service, Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceContract , to it a newer copy, System.ServiceModel.Security.WSTrustServiceContract . For some reason, it is not recognized by IntelliSense:

Blue line error:
The 'name' attribute is invalid - The value 'System.ServiceModel.Security.WSTrustServiceContract' is invalid according to its datatype 'serviceNameType'
I have links to the System.ServiceModel and System.IdentityModel <assemblies> in the <assemblies> node.
Even when I ignore the IntelliSense error and start the service and access it using a browser, I get this metadata error:
Metadata publishing for this service is currently disabled.
Metadata publishing is enabled, so I think this is due to a service name issue.
I also get this error from the VS.NET WCF Test Client:
Error: Cannot obtain Metadata from http://localhost:49178/Services/Issuer.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:49178/Services/Issuer.svc Metadata contains a reference that cannot be resolved: 'http://localhost:49178/Services/Issuer.svc'. There was no endpoint listening at http://localhost:49178/Services/Issuer.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. The remote server returned an error: (404) Not Found. HTTP GET Error URI: http://localhost:49178/Services/Issuer.svc The HTML document does not contain Web service discovery information.
I think the line " Metadata contains a reference that cannot be resolved " also refers to a service name resolution error.
Any ideas on what to do here? I would appreciate any help.
Issuer.svc:
<%@ ServiceHost Language="C#" Debug="true" Factory="Identity.Services.Wcf.Core.CustomSecurityTokenServiceContractFactory" Service="CustomSecurityTokenServiceConfiguration" %>
Factory:
public class CustomSecurityTokenServiceContractFactory : WSTrustServiceHostFactory ..
Services:
public class CustomSecurityTokenServiceConfiguration : SecurityTokenServiceConfiguration ..