PROFILE 1 - Null reference error clicking GO button
- Date: 22 Oct 2004
- Versions affected: 1.2x-1.3
When profiling a C/C++ project, you may recieve an error:
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.Object reference not set to an instance of an object
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
inside 'BLOCK 000004b0' and rebuilding the project again.VALUE "Assembly Version","1.0.0000.000"