Category : .NET

22 Nov

Porting .NET app to Vista.. DEP strikes!

by Marco Mastropaolo

An interesting issue happened these days when I tried to port some apps to Vista. Basically all .NET apps compiled with Visual Studio 2005/2008 are marked “NX compatible” by default. If your .NET app uses an incompatible DLL or COM object, the app will crash. What I found funny was that the message was a [...]

21 Nov

TargetInvocationException in asynchronous web service call

by Marco Mastropaolo

I’ve seen so many solutions around to solve a TargetInvocationException raised by an asynchronous web service call in .NET and they are all but satisfactory. Some go so far to create a worker thread which is overkill and, above all, a clear sign of cargo culting. The solution is very very simple. The exception is [...]

Filed Under: .NET, Programming

16 Apr

A little better MeasureString…

by Marco Mastropaolo

System.Drawing.MeasureString is a shit. You are better work it out with API calls and so on, but if you are on Mono that is out of choice. Apart from the known problems (not working correctly without Antialiasing enabled, requiring specific StringFormats), it also skips trailing spaces. At least this should fix that issue up: int [...]

Filed Under: .NET, Code Snippets, Programming