In my current project we’re using Moq as our mocking framework for unit testing. It’s a very nice package – very simple, very intuitive for someone who has his wrapped around basic mocking concepts, but tonight I ran into an annoying …
When developing WPF applications, Snoop is a wonderful tool that can let us see our visual tree at runtime, and find errors in data binding that are otherwise hard to track down in debugging. However, Snoop has an annoying limitation – it …
Tomorrow I am bidding my laptop farewell, and will soon buy me a new one. This results in what I like to call Settings Anxiety. I spend months tuning various aspects of my computer to my liking, and starting afresh with a new machine is …
A while ago, I posted an entry about marshalling a managed System.String into an unmanaged C string, specifically a plain char*. The solution I suggested, back in 2007, involved calling Marshal::StringToHGlobalAuto method to allocate memory …
Here’s a little gotcha I ran into today – if you have code in a class’s static constructor that throws an exception, we will get a TypeInitializationException with the original exception as the InnerException – so far, nothing new. However, …
A simple macro to change the Target Framework for a project from .NET 2.0 to .NET 3.5, hacked together in a few minutes. This will fail for C++/CLI projects, and possibly VB.NET projects (haven't checked). Works fine for regular C# …
I'm writing a piece of code that regularly polls a MOSS server and checks several files. This can happen quite a few times a day, and this totally skews my Usage Reports for my sites. Does anyone know of a way to tell MOSS to ignore calls …
Has anything been released - or, in fact, talked about - since August's release of the v1.1 CTP?
Haven't done any web-part development in a while and wanted to get back in the game. I last used the v1.0 extensions, and was surprised that …
I'll use my blog for a bit of fishing for advice and guidance on an issue that's been bugging me.
We've been moving towards using strong names on all of our assemblies. The benefits are obvious, and it's a must before we deploy to clients …
Just a quick heads-up in case you're stumped with this problem, or just passing by:
The System.Diagnostics.EventLogEntry class implements the Equals method to check if two entries are identical, even if they're not the same instance. …
I'm writing some benchmarking code, which involves a Console application calling a COM+ hosted process and measuring performance. I want to constantly display results on my active console, but since some of my code is running …
Another minor detail that bit me for a few minutes today. I'm posting this so I'll see it and remember, and possibly lodge it in other people's consciousness.
Using Visual Studio 2005, adding an existing .cs file to a C# project will cause …
Working with the Web Services in WSSv2 and v3 is an exercise in sheer frustration. I've written before about serious and glaring omissions in the Web Services API that Sharepoint exposes, but it's not only the things missing, it's the lack …
A few days ago I wrote of a GC hole I accidently created in my C++/CLI code (with thanks to commenter Nish for the name of the phenomenon). I had the following code snippet set inside a private function:
pin_ptr pinnedBuffer = &data[0]; …
In my current project, we have a windows service that we are developing and debugging, which involves a lot of installing/uninstalling the service. One common problem when uninstalling a service is that while the uninstallation is …
In my current code, I find myself accessing many Sharepoint web services. In one run of code I can access 5-6 different web services on dozens of different sites, not necessarily even on the same server. Given that I find myself writing a …
Yes, I know I am far from the first to bemoan the atrocious behavior of Visual Studio 2005 when you press the F1 button, even accidently. The first time you do it - or other times, if it deems the contents sufficiently changed for some …
Here's another nasty one that tried to bite me today. Let's say I have the following classes:
public class COMPlusClass : ServicedComponent
{
public COMPlusClass()
{
// Default initialization.
}
public COMPlusClass (string data)
{
// …
By a staggering margin, most of my problems integrating C++/CLI code into my C#-based project has been deployment problems. Without fail, every integration or test deployment will be plagued with inexplicable problems. I'll try to list a …