Thursday, May 29, 2008

WCF work environment

I wanted to share the work environment in which I debug Mono's WCF.

The idea is to run on .NET using the .NET tools and runtime, but taking specific libraries from Mono. The main advantage of this environment is the usage of the visual studio debugger greatly increasing productivity.

Step 1: Skip public key validation of (some) .NET assemblies
> sn -Vr System.ServiceModel,B77A5C561934E089
> sn -Vr System.Runtime.Serialization,B77A5C561934E089

Step 2: Place Mono assemblies in the GAC
The visual studio project files of System.ServiceModel and System.Runtime.Serialization have post build steps that do this. The comitted versions are remarked, so you want to remove the remark.

At this point you want to build the assemblies in VS2008 in order to place them in the GAC.

Step 3: Run your app
You can place breakpoints in Visual Studio. Very productive environment.

Step 4: Revert back to .NET
> "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe" /i "c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.ServiceModel.dll"
> "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe" /i "c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.Runtime.Serialization.dll"

Good luck,

Noam

No comments: