Bits and Pieces

Bits and Pieces

Tools and Code by Avner Shahar-Kashtan

Home Archive Categories Tags Blog Tools & Projects About Me RSS
  • Testing cross-post.

    2012-02-23 Avner Shahar-Kashtan Miscellaneous Debris
    Please ignore.
  • Moq, Callbacks and Out parameters: a particularly tricky edge case

    2011-10-07 Avner Shahar-Kashtan Miscellaneous Debris
    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 …
  • WPF: Snooping Attached Properties

    2011-09-01 Avner Shahar-Kashtan Miscellaneous Debris
    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 …
  • Saving Your Settings

    2009-02-10 Avner Shahar-Kashtan Miscellaneous Debris
    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 …
  • Tales from the Unmanaged Side – System.String –> char* (pt. 2)

    2009-01-13 Avner Shahar-Kashtan Miscellaneous Debris
    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 …
  • Static Constructor throws the same exception again and again

    2008-12-16 Avner Shahar-Kashtan Miscellaneous Debris
    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, …
  • Upgrading all projects to .NET 3.5

    2008-05-25 Avner Shahar-Kashtan Miscellaneous Debris
    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# …
  • Sneaking past the SharePoint Usage Log

    2008-04-16 Avner Shahar-Kashtan Miscellaneous Debris
    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 …
  • Any signs of life for the SharePoint Extensions for Visual Studio?

    2008-01-23 Avner Shahar-Kashtan Miscellaneous Debris
    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 …
  • Seeking advice - strong names and config files

    2007-12-20 Avner Shahar-Kashtan Miscellaneous Debris
    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 …
  • System.Diagnostics.EventLogEntry and the non-equal Equals.

    2007-11-25 Avner Shahar-Kashtan Miscellaneous Debris
    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. …
  • Displaying live log file contents

    2007-11-21 Avner Shahar-Kashtan Miscellaneous Debris
    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 C#/C++ difference - adding existing files

    2007-10-28 Avner Shahar-Kashtan Miscellaneous Debris
    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 …
  • Another Sharepoint Web Services rant : untyped data vs. incompletely typed data

    2007-09-06 Avner Shahar-Kashtan Miscellaneous Debris
    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 …
  • Return of the GC Hole: Another one from the C++/CLI trenches

    2007-09-06 Avner Shahar-Kashtan Miscellaneous Debris
    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]; …
  • Windows Services, services.msc and the "This Service is marked for deletion" error.

    2007-09-05 Avner Shahar-Kashtan Miscellaneous Debris
    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 …
  • Dynamically creating a Sharepoint Web-Service proxy instance

    2007-09-03 Avner Shahar-Kashtan Miscellaneous Debris
    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 …
  • Visual Studio help-launcher rant

    2007-09-03 Avner Shahar-Kashtan Miscellaneous Debris
    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 …
  • Wrong constructor called in COM+: sneaky, sneaky bug

    2007-08-30 Avner Shahar-Kashtan Miscellaneous Debris
    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) { // …
  • Unmanaged deployment is a true DLL Hell

    2007-08-29 Avner Shahar-Kashtan Miscellaneous Debris
    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 …
← Newer
2 / 10
Older →

Bits and Pieces — Tools and Code by Avner Shahar-Kashtan