Archive for the ‘.NET’ Category

Writing MiniDumps in C#

Saturday, December 13th, 2008

After creating my previous post (MiniDump support in .NET4), I tried to figure out how to write minidumps (MiniDumpWriteDump) without needing unmanaged code. I could not find any example… so I wrote one (which also works for x86 and x64/IA64).
Here is the example:
MiniDumpWriteDump direct from C# for x86 and x64/IA64.

MiniDump support in .NET4

Saturday, December 13th, 2008

After reading this post (CLR 4.0 advancements in diagnostics) I was happy that now the CLR team is investing resources in better debugging of minidumps.
I made a small example in C#4 and wanted to try this new feature in the VS2010CTP version. You just need to double-click on the dmp-file. It will start VS2010CTP. Then you will need to “start debugging” (for example press F10), and then you will get the following result-screen:
VS20010 CTP Mini-Dump debugging
So it seems that it works “mostly”. But the debugger seems to forget to switch to the exception callstack and instead displays the “minidump-writing callstack”. Hopefully this will be fixed in one of the next (beta) releases.
Here is the link to my connect-feedback: Debugging (managed) MiniDumps displays the writing-callstack and not the exception-callstack

VS2008 Service Pack 1 is available!

Monday, August 11th, 2008

Today, the first service pack for Visual Studio 2008 has shipped:
http://www.microsoft.com/downloads/details.aspx?FamilyID=27673c47-b3b5-4c67-bd99-84e525b5ce61&displaylang=en

But it seems that the installer is not very user-friendly:

If you previously installed a Visual Studio 2008 Hotfix, you must run the Hotfix Cleanup Utility before installing Visual Studio 2008 SP1. For more information, see Visual Studio 2008 Hotfix Cleanup Utility for Installing Visual Studio 2008 SP1.

Also, the KB article with the list of all fixes is not yet updated:
http://support.microsoft.com/kb/945140/en-us

Hopefully this SP will fix many bugs ;)

marshal_as library in VC2008

Thursday, February 14th, 2008

The VC++ team added a (simple) marshal_as library in VC2008. But this library only supports simple datatypes like

  • String^ to char* / wchar_t* / BSTR / bstr_t / CComBSTR / std::string / std::wstring / CString<char> / CString<wchar_t>  and vice versa
  • IntPtr to HANDLE  and vice/versa

So, the support only contains “Strings” and “Handle”. But this are the most commonly needed scenarios for marshaling.
The usage of some of the string marshaling is shown here:
http://www.c-plusplus.de/forum/viewtopic-var-p-is-1455833.html#1455833

An overview of the build-in marshaling can be found here: Overview of Marshaling in C++

There is a website (http://www.marshal-as.net/), in which you can look-up additional marshaling implementations like:

Hopefully many, more will follow…
If you have an implementation of some kind of “marshal_as”, just put a comment to Kate Gregory

Visual Studio 2008 Product Comparison

Thursday, February 7th, 2008

Microsoft published a very comprehensive product comparsion page.

It contains over 450 features in 25 sections, comparing 11 products.

It is really worth looking at it:

Visual Studio 2008 Product Comparison

ADD: 2009-05-29
(this link seems to be out-dated, for a complete data-sheet see:
Visual Studio 2008 Product Comparison Guide

Want to download the complete .NET source code?

Wednesday, February 6th, 2008

In one of my last posts I said that the .NET source code is available. While this is still true, you might have seens some trouble in getting the source, because the source is only available on demand while debugging a component. Also you must setup VS to retrive the source/PDBs.

But if you just want to look at the source, there was no easy way to do this.

On CodePlex there is now a tool called NetMassDownloader, which allows to download the complete source (or only from indivudual DLLs) to a directory.

Have fun!

A new team is now improving MSDN Help!

Wednesday, January 30th, 2008

Since VS2002 the new help system was really bad. And it got even worser in every release of visual studio. The slowest version was starting with VS2005 and VS2008. Now MS has heard us!

April announced on her weblog, that MS has now set up a new team to “redesign” the MSDN Help system:

Help is Getting Help - The Long Overdue Makeover for Visual Studio and MSDN Help

Really great news! Hopefully this project will be successful!

.NET Source Code now available!

Thursday, January 17th, 2008

The .NET Framework Source Code is now available for reference and debugging!

For more info see:

It seems that you just need to install an QFE for VS2008 and then it works. No need to sign anything…

VS2008 will be available beginning of next week

Saturday, November 17th, 2007

According to the MSDN-Subscription-Blog, VS2008 will be available for download beginning of next week. Great news!

Hotfix for Performance Improvements in VC2005

Tuesday, November 13th, 2007

In case you have not yet seen this: Performance Improvements in Visual C++

You can install this public hotfix to improve the performance of your VS experience while working with VC++ projects.

Just one side-note: There is currently only the English-Version of this hotfix available.

TechEd-Developer Session: VC++ and Windows Vista: A Natural Fit

Wednesday, November 7th, 2007

Kate Gregory showed that C++/CLI is the best and sometimes the only (allowed) language to access all the Vista features.
In short:

  • Only in VC++ you can access all Vista features
  • Some Vista features are easier to access from VC++
  • Some Vista features are only accessible from VC++ ;)
  • Some Vista features must be written in native code (like PropertyHandler, ThumbnailHandler)
  • C++/CLI is a “natural” and “must have” tool to fully develop for Windows Vista
  • C++/CLI is the best language for InterOp

The first impressions about TechEd Developer / Great news about C++

Wednesday, November 7th, 2007

Maybe my exüectatiosn were too high… in general I would say that most of the sessions do not go deep. Mostly they only touch the surface…

Of course, there are also some exceptions: All C++ sessions are realy great!

The first session was “What’s new in Visual C++ 2008″. Just a short overview:

  • Vista only: In the Project Properties under “Manifest” you now can explicite set the UAC-Level (asInvoker, highestAvailability, requireAdministrator); so no need to specify this “by hand”; if you upgrade your project it will by default generate an manifest with UAC set to “asInvoker”, so you do not face virtualization problems under Vista
  • Class designer for C++; but only for viewing; there is currently now two-way direction for editing in the class designer and reflection this changes in he code; but better than nothing…
  • Vista-only: Randomizing the base address; this allows vista to use a random base address at startup; this helps to prevent code-injection into the process; this is also on by default for all MS DLLs. Also you can mark your program that it can deal with “data execution prevention /NXCOMPAT)
  • Multiprocessor build for cl.exe! This is also great news! It will allow to speed up the build process even if you just have one project (in VS2005 multi processor support was only possible if you had many solutioons which did not depend on each other)
  • Incremental build for managed code
  • Many areas with performance improvements in VS2005, like: Load solution performance, editor/IntelliSense responsiveness

The second session was “Best practices for Native-Managed InterOp in VC++ 2008 ; also a short summary:

  • Introduction to STL.NET (STL which can be used with managed types); these system is faster than the .NET collections ;)
  • Marshaling Library (marshal_as<to> (from) ); this is a very exciting feature and can be extended with only implementations

So today, we can be look forward to see the two sessions about C++/CLI with Vista and MFC-Updates!

Stay tuned…

First day (5.11.2007) at TechEd Barcelona…

Tuesday, November 6th, 2007

Ok, the first day has started with nice 16 degree Celcius ;)
The plane was a bit too late so I missed parts of the keynote. The biggest news (for me) from the keynote is, that VS2008 will be available late this month to all MSDN subscribers.

In an other session someone from MS (Steven Martin) announced a new tool for model design which will replace all various existing tools (codename Oslo). The release will be Orcas+1 ;)
In an other session, Matt Winkler (somehow looks like Don Box ;) ) and David Aiken showed an example (DinnerNow) of an application by using over 20 of the newest MS technics: starting from WCF over WPF, AJAX, Vista-Gadgets, Silverlight, PowerShell, Cardspace, MMC-SnapIn, …
Quite impressive what can be done (if you have enought time ;) ).

Today I will join the second part of the last session, which will explain how the did the whole stuff. Then I will go to an WPF session (Designd Rich Client Experiencse with WPF).

The upcoming C++ sessions:

Today:
13:30-14:45 “What’s New in Visual C++ 2008?”

Wedensday
9:00-10:15 “C++/CLI and Windows Vista: A Natural Fit”
15:15-17:00 “MFC Updates for Visual Studio 2008 and Beyond”

Thuresday:
9:00-10:15: “Exploring the Upcoming C++ Standard: C++ 0x and TR1″

TechEd-Developer in Barcelona!

Saturday, November 3rd, 2007

Currently I pack my bag, so I can fly to Barcelona and visit the biggest european developer conference for Microsoft products from 5th until 9th November 2007.
TechEd-Developer:
http://www.microsoft.com/europe/teched-developers

I think this event will be a great presentation of the new products from microsoft. Also you have the opportunity to meet several program managers from the various product teams and share you oppinion about the products.

You can also meet me at the ATE (Ask the expert) lounge at station 33/34!

See you!

Moving my old blog to this one…

Saturday, November 3rd, 2007

Hi!

After becoming a freelancer, I also registered a new domain (http://www.kalmbach-software.de/). The site is still under construction, but today I set up my blogging software to move my old blog (http://blog.kalmbachnet.de/) to this new system.

 Hopefully you enjoy this new blog!