Error building Mission Planner in VS 2022

I’m trying to build Mission Planner from Github code using Visual Studio 2022 v17.7.6. I installed VS using configuration suggested in README.md and executed the steps as follow:

  • Install submodules using git submodule --init --recursive
  • Remove WindowStore project from the solution
  • Build GDAL.NET project
  • Build MissionPlanner project
    The MissionPlanner build failed with the following error:
The command "copy D:\Work Projects\MissionPlanner\\ExtLibs\System.IO.Compression.dll D:\Work Projects\MissionPlanner\bin\Debug\net461\" exited with code 1.			

Build output also report 1 failed:

32>  MissionPlanner -> D:\Work Projects\MissionPlanner\bin\Debug\net461\MissionPlanner.exe
32>  The system cannot find the file specified.
32>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(5778,5): error MSB3073: The command "copy D:\Work Projects\MissionPlanner\\ExtLibs\System.IO.Compression.dll D:\Work Projects\MissionPlanner\bin\Debug\net461\" exited with code 1.
========== Build: 31 succeeded, 1 failed, 22 up-to-date, 0 skipped ==========

Please help me resolve this problem.

Do you have net 4.7.2 installed ?

I installed .NET 4.8.09032. Do I need to downgrade it to 4.7.2 ?

Not downgrade, install. Different versions of .net framework are coexists.

I got .NET 4.7.2 installed. However the problem stays the same. Do I need to modify anything in the VS config as well? I’m not quite familiar with VS and .NET

Two solutions.

  1. Don’t use space in your folder names.
  2. If you insist on spaces, then go to MissionPlanner project properties, in Build Events change the Post build event command line to :
    copy "$(ProjectDir)ExtLibs\System.IO.Compression.dll" "$(ProjectDir)$(OutDir)"
1 Like

It worked! Thank you so much. I knew spaces can cause problems but I did not expected that VS had the same issues too. I actually thought VS2022 was capable to handled it

Actually it is not VS problem, it was a custom post build command what did not considered spaces… I added a PR to fix it permanently.

1 Like