Compile error in Mission Planner

Hi all,

I am trying to build Mission Planner as Described here Building Mission Planner with Visual Studio. I get the following compile error

Severity Code Description Project File Line Suppression State
Error MSB4018 The “ResolvePackageDependencies” task failed unexpectedly.
System.ArgumentException: Invalid framework version ‘10.0.14393/win10-x64’.
at NuGet.Frameworks.NuGetFramework.ParseFrameworkNameParts(IFrameworkNameProvider mappings, String[] parts, String& framework, Version& version, String& profile)
at NuGet.Frameworks.NuGetFramework.ParseFrameworkName(String frameworkName, IFrameworkNameProvider mappings)
at NuGet.Frameworks.NuGetFramework.Parse(String folderName, IFrameworkNameProvider mappings)
at Microsoft.NET.Build.Tasks.ResolvePackageDependencies.b__48_5(String tg)
at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext() at System.Linq.Enumerable.Contains[TSource](IEnumerable1 source, TSource value, IEqualityComparer1 comparer) at System.Linq.Enumerable.WhereListIterator1.MoveNext()
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
at Microsoft.NET.Build.Tasks.ResolvePackageDependencies.g__GetPackageDiagnosticLevel|48_0(LockFileLibrary package)
at Microsoft.NET.Build.Tasks.ResolvePackageDependencies.GetPackageAndFileDefinitions()
at Microsoft.NET.Build.Tasks.TaskBase.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() WindowsStore C:\Program Files\dotnet\sdk\6.0.301\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 195

Can anyone help please?

BTW I’m a bit confused as to what version of Visual Studio is required. The doc as above mentions 2019. Github says 2022. I use Microsoft Visual Studio Enterprise 2022 (64-bit) - Current Version 17.2.5.

Many thanks in advance,
Greg.

unload this project for now “WindowsStore” and try it again

Hi Michael,

Spot on, the Mission planner project compiles now without that error.

There is another compilation problem though referring to

Could not find file ‘D:\Projects_PhD\ArduPilot\GitHub\MissionPlanner\ExtLibs\GDAL\bin\Debug\net461\GDAL.NET.dll’. MissionPlanner D:\Projects_PhD\ArduPilot\GitHub\MissionPlanner\test\FirmwareSelection.xaml

This is unrelated to the WindowsStore project. This is happening when I try to rebuild the whole solution. However, running Mission Planner in VS starts fine. I am not sure though whether there will be a problem at some point during runtime with that dll missing GDAL.NET.dll .

Thanks,
Greg

looks like you nuget restore is faiiling for some reason… i can only point you in a direction im afraid.

Hi Michael,

I just realised who I was talking to. First of all many thanks for your comments and congratulations for the best GSC in the field.

I just wanted to add a few more comments just in case it helps others.

The dll that it complains it is there even though it says file not found!

‘D:\Projects_PhD\ArduPilot\GitHub\MissionPlanner\ExtLibs\GDAL\bin\Debug\net461\GDAL.NET.dll’

The other thing is that the error seems to be coming from this

‘D:\Projects_PhD\ArduPilot\GitHub\MissionPlanner\test\FirmwareSelection.xaml’

which seems to be a test?

Can I remove it?

BTW I get the same error by just trying to build the ExtLibs\Drawing\GDAL.NET project.

The dependency projects for the GDAL.NET project build fine.

Thanks,
Greg

By the looks of it the error message is very misleading.

I made it to compile by doing this.

  1. Removed the WindowsStore project from the solution as suggested by Michael.
  2. Cleaned the solution.
  3. Build the GDAL.NET project in ‘ExtLibs\Drawing’
  4. Build the Mission Planner project
  5. Build the whole solution.

After that you will be able to run/debug the Mission Planner. What did the trick is building the projects in the correct sequence as above and the fact that I did not use Rebuild at any stage!

If you try to use Rebuild at any project or the solution itself, it will throw the error about the missing dll. Odd but there you go…

At least for now, we have a workaround.

Many thanks,
Greg.

please tell me if you have a solution now, and how to solve it

i get the code in github,and now i meet this problem,please tell me how to solve it.

I got these errors while compiling;

Severity Code Description Project File Line Suppression State Details
Error CS0579 Duplicate ‘global::System.Runtime.Versioning.TargetFrameworkAttribute’ attribute 7zip (netstandard2.0) C:\Users\hp\source\repos\MissionPlanner\ExtLibs\7zip\Compress\LzmaAlone\obj\Release.NETFramework,Version=v4.0.AssemblyAttributes.cs 4 Active
Severity Code Description Project File Line Suppression State Details
Error CS0579 Duplicate ‘global::System.Runtime.Versioning.TargetFrameworkAttribute’ attribute 7zip (netstandard2.0) C:\Users\hp\source\repos\MissionPlanner\ExtLibs\7zip\obj\Debug\netstandard2.0.NETStandard,Version=v2.0.AssemblyAttributes.cs 4 Active

Does anyone face these issues?