Creating metadata from WCF executables

So I’ve started messing around with WinFX and WCF.
It certainly feels like it needs more work, especially on the dev-tool end of things.

I was trying to run SvcUtil to generate metadata and proxy from a console application and ran into this error message:
 
Error: There was an error exporting the ContractDescription loaded from the type
: Strawjackal.WCFTest.IService, MyService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
    Duplicate contract QNames are not supported.
Another ContractDescription with the Name: IService and Namespace:
Strawjackal.WCFTest has already been exported.

This was very confusing until I found this page here explaining that SvcUtil is simply broken when running on EXE assemblies. The original poster’s solution was to recompile his assembly as a class, but I’ve discovered that an even simpler solution is to just rename my EXE to a DLL, run SvcUtil against it, and rename it back.

WSDL created.
Me happy.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.