Problems with editing vcxproj files RRS feed

  • Question

  • I am working migrating a large code base to visual studio 2010. I have managed to convert the existing project files to vcxproj files. On loading the solution, a random number of projects are not loaded because of the following error:

    "error  : The imported project "C:\7_Develop\swapswire.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.  C:\7_Develop\pdf_lib\pdf_lib.vcxproj"

    I then attempt to resolve the problem by removing "<Import Project="..\swapswire.props" />" from the given vcxproj file:

    <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
      <ImportGroup Label="ExtensionSettings">
        <Import Project="..\swapswire.props" />

    After doing this, I reload the project and all appears ok. However, when I close and reopen the solution file I get the follwoing error in the vcxproj file:

    "Could not find project item with item type 'ClCompile' and include value 'XXXX.cpp'."

    I then re-add the deleted line in the vcxproj "<Import Project="..\swapswire.props" />" but I still get the above error (I was expecting to see the previous error)

    "Could not find project item with item type 'ClCompile' and include value 'XXXX.cpp"

    Your help would be appreciated

    • Moved by eryang Friday, October 29, 2010 3:51 AM Move to VSX forum for better support. (From:Visual Studio Performance Tools (Profiler))
    Thursday, October 28, 2010 5:25 PM

All replies

  • Hi,

    You should close and reopen the solution file when making manual edits to imports to ensure that VS is reading the latest file.



    Wednesday, August 3, 2011 9:20 PM