Friday, January 21, 2011

WIF : Problems with SecurityTokenVisualizerControl

This control shows the token information for WIF / ADSL v2.

The control can be downloaded from Security Token Visualizer Control.

The problem is that the wizard looks for Visual Studio 2008. I have Visual Studio 2010 but the wizard doesn't think that's good enough!

Also, it tells me that I don't have the WIF SDK installed. Actually, I do!

Workaround:

Once you've installed the download, don't bother with the wizard - it requires VS 2008 etc.

Navigate to:

C:\IdentityTrainingKit2010\SecurityTokenVisualizerControl\code\Microsoft.Samples.DPE.Identity.Controls

or wherever you installed it and then open:

Microsoft.Samples.DPE.Identity.Controls.csproj

in VS.

You'll have to convert it from an older standard (just reply "Yes" to the question).

Then build it. You now have a .dll in the \bin directory.

Add this .bin to the Toolbar viz. Right click on Toolbar - "Add Tab" - give it a name like "Security Token Visualizer Control".

Then right-click on the new tab - "Choose Items" and browse to the .dll.

The control will now be in your toolbar ready to be dragged onto your page.

Remember to add saveBootstrapTokens="true" to the web.config.

Enjoy!

Thursday, January 13, 2011

WCF : Could not find default endpoint element that references contract

Working through the WCF samples, I came across the in-line calculator.

Built it according to the instructions (using Visual Studio 10 and .NET Framework 4), ran it up and got the following exception:


Could not find default endpoint element that references contract 'ICalculator' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.


A lot of communication with Mr. Google and then came across a comment way down in a blog entry that offered some hope.

To generate the proxies, you run:


svcutil.exe http://localhost/IISHostedCalc/service.svc?wsdl


This generates two files:

CalculatorService.cs
output.config

and you add them to your project using "Add Existing Item".

To get rid of the exception, simply rename "output.config" to "app.config" and ensure it is part of your project.

Enjoy!