Dec 6, 2010 at 3:06 AM

I was in need of a single instance controller for my WPF application and came across your solution.

I found this very easy to incorporate into my application and it compiled using .NET Framework 4 as the Target framework.

I notice on your solution that you have a region that reads


 I further note that Method protected override Guid GenerateApplicationGuid() Is dulled out, so visual studio can detect “USE_ASSEMBLY_GUID”

 I cannot duplicate this behaviour. Using the tools menu in Visual Studio I generated a Guid and pasted this Guid into the Assembly information.

 Are you able to advise why I do not experience the same behaviour as your example?



Dec 6, 2010 at 10:12 AM

The USE_ASSEMBLY_GUID is just a compilation switch I defined in the sample files to show the two possible ways of defining the application identifier (either define an assembly Guid or override the GenerateApplicationGuid). When using compilation switches, source code that will not be compiled is grayed out; in the samples the constant USE_ASSEMBLY_GUID is defined in the assembly Properties, inside the Build pane.

In your code you don't need to define a compilation switch, you either produce an assembly Guid or override the GenerateApplicationGuid function, depending on your needs.