Miscellaneous Debris

Avner Kashtan's Frustrations and Exultations

Browse by Tags

All Tags » .NET (RSS)
Tales from the Unmanaged Side – System.String –> char* (pt. 2)
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 and copy the...

Posted Tuesday, January 13, 2009 5:04 PM by Avner Kashtan | 3 comment(s)

Filed under: , ,

Static Constructor throws the same exception again and again
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, if we keep...

Posted Tuesday, December 16, 2008 12:17 PM by Avner Kashtan | 5 comment(s)

Filed under: , ,

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)

Any signs of life for the SharePoint Extensions for Visual Studio?
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 nothing much...

Posted Wednesday, January 23, 2008 9:57 PM by Avner Kashtan | 1 comment(s)

Filed under: ,

Seeking advice - strong names and config files
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 out in the wild...

Posted Thursday, December 20, 2007 1:48 PM by Avner Kashtan | 4 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 | 4 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 | 7 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: , ,

Unmanaged deployment is a true DLL Hell
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 few, with their...

Posted Thursday, August 30, 2007 2:16 AM by Avner Kashtan | 1 comment(s)

Filed under: ,

More Posts Next page »