PROFILE 1 - Null reference error clicking GO button

Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
edited December 1, 2005 7:11AM in Knowledge Base
  • Date: 22 Oct 2004
  • Versions affected: 1.2x-1.3

When profiling a C/C++ project, you may recieve an error:
Object reference not set to an instance of an object
This error happens because ANTS Profiler cannot determine if the code has been compiled as managed code. ANTS Profiler performs this check so that it can inform you that you are about to profile unmanaged code and since ANTS Profiler doesn't support this, you would recieve blank results.

ANTS Profiler determines if the code is managed by checking the 'Assembly Version' of the executable you are profiling from the file's properties. By default, Visual Studio writes this information into assemblies written in C# or Visual Basic, but neglects to do this in the C and C++ languages.

To rid yourself of the 'object reference' error, simply create a Version resource by right-clicking on the C++ project, selecting Add, then Add Resource. Choose Version and click New.

At this point, ANTS Profiler will still complain about the code being unmanaged, but you can click OK and continue profiling without problems.

If you are determined to rid yourself of the 'unmanaged code' warning message, the only way to do this is to manually add the 'Assembly Version' string by editing the 'app.rc' file in Notepad, locating the 'StringFileInfo' block and adding
VALUE "Assembly Version","1.0.0000.000"
inside 'BLOCK 000004b0' and rebuilding the project again.


Sign In or Register to comment.