Miscellaneous Debris

Avner Kashtan's Frustrations and Exultations

Browse by Tags

All Tags » C# (RSS)
Upgrading all projects to .NET 3.5
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# projects, as well as...

Posted Sunday, May 25, 2008 11:56 AM by Avner Kashtan | 2 comment(s)

System.Diagnostics.EventLogEntry and the non-equal Equals.
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. However, contrary...

Posted Sunday, November 25, 2007 8:12 PM by Avner Kashtan | 3 comment(s)

Filed under: , ,

Displaying live log file contents
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 out-of-process, I can't really...

Posted Wednesday, November 21, 2007 4:12 PM by Avner Kashtan | 3 comment(s)

Filed under: , ,

Another minor C#/C++ difference - adding existing files
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 a copy of that...

Posted Sunday, October 28, 2007 5:35 PM by Avner Kashtan | 1 comment(s)

Filed under: , ,

Dynamically creating a Sharepoint Web-Service proxy instance
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 lot of boilerplate...

Posted Monday, September 03, 2007 7:55 PM by Avner Kashtan | 5 comment(s)

Wrong constructor called in COM+: sneaky, sneaky bug
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) { // Parameterized initialization...

Posted Thursday, August 30, 2007 5:35 PM by Avner Kashtan | 1 comment(s)

Filed under: , ,

More Tales from the Unmanaged Side - System.String -> char*
Today, I had a very tight deadline to achieve a very simple task: pass a managed .NET string to an API function that expects a null-terminated char*. Trivial, you would expect? Unfortunately it wasn't. My first though was to do the pinning trick that...

Posted Tuesday, August 28, 2007 7:08 PM by Avner Kashtan | with no comments

Filed under: , ,

A C# coder in a C++/CLI world, part 1
Recently I've found myself stumbling around some C++/CLI code. C++ is a language which I learned years ago and never really worked with seriously, so I've been cursing and moaning as I worked. Strange for me to go back to a (partially) unmanaged environment...

Posted Tuesday, August 28, 2007 4:48 PM by Avner Kashtan | 3 comment(s)

Filed under: , ,

Allowing timeout on long-running operations - possible bug
A while ago, I wrote about a simple pattern to allow us to put a timeout limitation on a long running operations. Simply put, it allows us to replace this: public MyObject GetData() { try { MyObject data = BigComponent.LongRunningOperation(); return data;...

Posted Monday, August 27, 2007 10:18 AM by Avner Kashtan | 1 comment(s)

Filed under: , ,

Some more glaring omissions in the Sharepoint 2007 SDK and Web Services
I downloaded the new Sharepoint 2007 SDK today, published last week though it's dated from April 2007. There appears to be no change history for this version of the SDK. I was hoping for more information on new Web Service methods available in 2007 -...

Posted Wednesday, July 18, 2007 11:57 AM by Avner Kashtan | 3 comment(s)

Filed under: , ,

More Posts Next page »