Search code examples
c#winformsvisual-studio-2012resx

When opening a .resx file in Visual Studio 2012, gives "The operation could not be completed. Invalid pointer" error


I am trying to modify a resx file for a form after setting the form "MainForm" to be localizeable. When I try to open the file "MainForm.resx", it now gives the error "The operation could not be completed. Invalid pointer". I am running Visual Studio 2012.


Solution

  • I ran into this exact same issue and it turns out I had some invalid xml in my resx file.

    I had the following:

    <data name="UNIT_MEASURE_CUBE_S1" mimetype="ZONE">
        <value>U/M for Cube</value>
    </data>
    

    In the above mimetype was the invalid xml. I removed this so I was left with this:

    <data name="UNIT_MEASURE_CUBE_S1">
        <value>U/M for Cube</value>
    </data>
    

    The way I was able to narrow this down was to remove half of the resources within the resx file save it and try to load it in visual studio. If that worked I knew the problem was in the last 1/2 of the xml. I continued to do this until I could narrow it down to a small section of the resx file. Eventually I found my issue.