Uploaded image for project: 'Qt Visual Studio Tools'
  1. Qt Visual Studio Tools
  2. QTVSADDINBUG-1226

Exception thrown when trying to convert a *.vcxproj to a Qt/MSBuild project

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • 3.3.0
    • 3.2.0
    • General
    • Windows 10 22H2, Visual Studio 2022

    Description

      Code
      CMakeLists.txt

      cmake_minimum_required(VERSION 3.16)
      project(HelloWorld LANGUAGES CXX)
      
      add_executable(HelloWorld
          main.cpp
      )
      

       

      Steps to reproduce

      1. Use CMake to convert the attached project to a Visual Studio Solution. For example : cmake -G "Visual Studio 17 2022" -B sln .
      2. Open HelloWorld.sln with Visual Studio 2022 (which has Qt VS Tools installed)
      3. Try to convert the project to a Qt/MSBuild project

       

      Outcomes
      Conversion fails with the following exception:

      An exception (NullReferenceException) occurred.
      Message:
         Object reference not set to an instance of an object.
      Stack Trace:
         at QtVsTools.Core.MsBuild.MsBuildProjectReaderWriter.<>c.<get_Globals>b__23_0(XElement x)
         at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
         at QtVsTools.Core.MsBuild.MsBuildProjectReaderWriter.get_Globals()
         at QtVsTools.Core.MsBuild.MsBuildProjectReaderWriter.V3FormatVersion()
         at QtVsTools.Core.MsBuild.MsBuildProjectReaderWriter.ConvertToV3()
      

      Attachments

        1. vs-conversion-failed.png
          3 kB
          Sze Howe Koh
        2. vs-convert-to-qtmsbuild.png
          28 kB
          Sze Howe Koh
        3. VSProjectTest.zip
          0.5 kB
          Sze Howe Koh
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ali.demiralp Ali Can Demiralp
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes