THINK

that’s how i naturally know

WCF Gotcha: Windows Service cannot start because ServiceMeta HttpGet is true

leave a comment

When using WCF + Windows Service + net.Tcp binding, ServiceBehavior > ServiceMeta > HttpGet must be set to false. It normally defaults to true when first created in WCF Configuration Editor. The fastest way to get rid of it is to edit the App.config XML directly, deleting the related <serviceMeta> tag.

Written by Jake

December 19th, 2011 at 11:17 am

Posted in Programming

Tagged with

Remote Desktop full screen mode not working in secondary monitor

leave a comment

After fiddling around with this irritating nonsense for a while, I came to know the real meaning of the full screen option in Remote Desktop settings.

Instead of the intuitive meaning of really full screen in the monitor you maximise on, it actually means “same resolution as my primary monitor”.

To get it to full screen on any screen, set it to start in windowed mode and then maximise it in the monitor you want.

This post has more details: http://www.codinghorror.com/blog/2006/04/remote-desktop-tips-and-tricks.html

Written by Jake

December 15th, 2011 at 9:50 am

Posted in Computer

App.Config configuration startup in mixed mode .NET runtime version

leave a comment

If an application or DLL is compiled to in a .NET runtime vresion and references another DLL which is in another .NET runtime version, then it may cause an exception stating that the application is unabled to load DLL in mixed runtime mode.

The solution is to have an app.config file (athough I think there must also be a way without it) in the same directory as the executable and have this lines in it under in the XML hierarchy:

<configuration>
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    </startup>
...

The key here is “useLegacyV2RuntimeActivationPolicy”. Look up the latest values to suit your runtime versions.

Written by Jake

December 7th, 2011 at 3:07 pm

Posted in Programming

Tagged with

WCF Tutorial: WCF Service with Windows Service (Part 3 of 3)

leave a comment

Just a stub

Creating Service Contract
Creating DataContract
Creating FaultContract

Creating Windows Service Host
Creating Proxy
Creating Client

Creating app.config with WCF config Editor in Microsoft Visual Studio 2010
Installing/Uninstalling/Starting/Stopping Windows Service Host with sc.exe
Use client to connect proxy to host, and consuming services.

Programatically configure service and proxy using and without using app.config

Concepts beyond: Port sharing, IIS hosting, behaviors, tracing, message logging, using MSVS tools to do Metadata extraction.

Written by Jake

December 7th, 2011 at 2:55 pm

Posted in Programming

Tagged with ,

WCF Tutorial: WCF jargon (Part 2 of 3)

leave a comment

Just a stub:

Service
Host
Endpoint
Binding
Metadata
Behavior
Protocol

Tracing
Message
Fault

Proxy
Client

Written by Jake

December 7th, 2011 at 2:47 pm

Posted in Programming

Tagged with ,

WCF Tutorial: WCF Overview (part 1 of 3)

leave a comment

Just a stub first:

WCF is Windows Communications Foundation
By default, it sends message using SOAP protocol by serializing data structures into XML.
For serialization, it specifies the DataContract and DataMember attributes.
For Interface programming, it specifies the ServiceContract and OperationContract attributes.
For Error and Exception handling, it specifies the FaultContract attribute.

Language agnostic (the only thing fixed is SOAP) such that JAVA or other apps can consume the services.
Hide implementation and expose only interface specific faults (as oppoosed to Exceptions)

A WCF service is typically compiled as an independant DLL that can be hosted by one of several methods i.e. IIS, Windows Service or Self-hosted e.g. in a WinForms application, WPF application.

The Microsoft .NET 4.0 framework with Microsoft Visual Studio 2010 provide some magic code and convenient designer UI to build both the WCF service and the client.

Written by Jake

December 7th, 2011 at 2:44 pm

Posted in Programming

Tagged with ,