Following the instructions here: http://msdn.microsoft.com/en-us/library/ee517277.aspx, I am trying to set up a WCF service to use WIF.
When I try to instantiate the ServiceHost
, the following exception is thrown:
The type 'Microsoft.IdentityModel.Configuration.ConfigureServiceHostBehaviorExtensionElement' registered for extension 'federatedServiceHostConfiguration' could not be loaded.
I have never set up WCF service to use WIF before, but I have successfully set up web sites to use WIF. What could be causing this?
Module Module1
Sub Main()
Dim sh As ServiceModel.ServiceHost
''#Exception thrown on following line
sh = New ServiceModel.ServiceHost(GetType(testService))
Microsoft.IdentityModel.Tokens.FederatedServiceCredentials.ConfigureServiceHost(sh)
sh.Open()
Console.WriteLine("Service running")
Console.ReadLine()
sh.Abort()
End Sub
End Module
<?xml version="1.0" encoding="utf-8" ?>
<configuration><system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="ClaimsBehavior" >
<federatedServiceHostConfiguration/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="ClaimsBehavior" name="WCFConsoleService.testService">
<endpoint address="net.tcp://localhost/testservice" binding="netTcpBinding"
bindingConfiguration="" contract="WCFConsoleService.iTestService" />
</service>
</services>
<extensions>
<behaviorExtensions>
<add name="federatedServiceHostConfiguration"
type="Microsoft.IdentityModel.Configuration.ConfigureServiceHostBehaviorExtensionElement" >
</behaviorExtensions>
</extensions>
</system.serviceModel>
</configuration>