Archives for the '.NET' Category
How to: Host a WCF Service in a Managed Windows Service
The MSDN Library sample code for hosting a WCF service in a Windows service contains some mistakes and the steps are incomplete.
Steps not specified:
1. Create a Console Application project. There is actually a "WCF Service Application" project type in Visual Studio 2008 – do not use it for this example.
2. Delete Program.cs from the project.
3. [...]
Creating a Certificate for a WCF Service
Michele Leroux Bustamente's excellent article details out the Web.config settings for a WCF service that requires UserName credentials. The intention is for a RoleProviderPrincipal with a GenericIdentity reference to be attached to the thread, instead of a WindowsPrincipal with a WindowsIdentity reference which is the default.
To create the certificate required by the service, use the [...]
.NET Architectural Cheat Sheet
CodePlex (Microsoft's open source project hosting web site) has a Patterns & Practices Catalog At A Glance Cheat Sheet. It's quite a long list. You might want to at least glance through it before starting on the architecture of your next .NET solution.
Cryptographic failure while signing assembly
Today I encountered the following error whilst building a solution using Visual Studio 2008:
Cryptographic failure while signing assembly 'SomeAssembly.dll' -- 'The key container name 'KeyName' does not exist'
When I tried to create the key manually by typing the following in the Visual Studio 2008 command prompt:
sn.exe -i MyKey.snk KeyName
I got the following error:
Failed to install [...]
Bug in SgmlReader
Update 20 April 2010
SgmlReader 1.8.6 has this problem fixed.
Original post
Chris Lovett of Microsoft wrote SgmlReader 1.7 and has kindly shared it with the world. What does it do? In his own words:
An XmlReader implementation for loading SGML (including HTML) converting it to well formed XML, by adding missing quotes, empty attribute values, ignoring duplicate attributes, [...]