Friday, July 16, 2010

"Invalid pointer" error in Visual Studio 2010 in Configuration Manager

I've been fighting against a problem I've seen in most of my project files that were upgraded from VS2005 or VS2008. Any attempt to delete a Configuration or a Platform results in the error "The operation could not be completed. Invalid pointer."

Today I was finally able to track down the problem, which is caused by some seemingly benign lines in the .vcxproj file. To fix the problem, open your .vcxproj file in Notepad, go to the end of the file, and you'll find some lines that look like this:

<ProjectExtensions>
  <VisualStudio>
    <UserProperties RESOURCE_FILE="Dot.rc" />
  </VisualStudio>
</ProjectExtensions>


Remove those lines, reload the project, and everything will start working fine. Those lines do not appear in project files that are created by the Visual Studio 2010 wizard, so I believe that they are not needed.
 
My complete bug report can be found on Microsoft Connect:
https://connect.microsoft.com/VisualStudio/feedback/details/575911/invalid-pointer-error-deleting-configurations-in-upgraded-vs2010-c-project-files#tabs

6 comments:

  1. I get the same problem.
    Migration from 2008 to 2010, adding new configurations and as a result: error on trying to remove any project configuration, even the old one (before migration).

    In UserProperties I have another options:

    lupdateOnBuild="0"
    MocDir=".\GeneratedFiles\$(ConfigurationName)"
    MocOptions=""
    QtVersion_x0020_Win32="$(DefaultQtVersion)"
    RccDir=".\GeneratedFiles"
    UicDir=".\GeneratedFiles"

    But, nevertheless, deleting of "ProjectExtensions" whole tag solves the problem!

    P.S. Unfortunately it's not obvious (for me) why it happened.

    THANKS A LOT!

    ReplyDelete
  2. deleting of "ProjectExtensions" magically fixed the microsoft bug. project configuration can now be deleted :)

    ReplyDelete
    Replies
    1. The solution worked perfectly. Thank you very much.

      Delete
  3. I get this error in a brand new VS 2010 project. We use a lot of css, and this always happens in files where i have css links and begin to type in-line css in the style tag (i.e. style="width: 20px;") and it will just stop typing. I can hit any key and it just wont continue to type, when i try to backspace, I get the error.

    Can't find anything on this in google...

    My current workaround is to close the solution, and re-open then it works. So annoying.

    ReplyDelete
  4. Nice catch. To say that was causing me frustration, well, let's just say there was cursing involved.

    ReplyDelete
  5. Nice finding, Thanks!

    ReplyDelete