Replies: 1 comment 1 reply
-
I think the problem is that the sample was not updated as tooling changed. Historically, C++ projects ( NuGet has a bug/design choice where PackageReference restore always names one of restore's output files as The sample has both a You can work around the issue by creating a The NuGet team prioritize work based on a number of signals, one of which is the number of upvotes (👍 reactions), so upvoting #4463 might get it prioritized more quickly. If you believe that vcxproj projects shouldn't use Microsoft.NuGet.targets on project types that don't support PackageReference, then please search for an issue on https://developercommunity.visualstudio.com and upvote it, or create a new issue using Visual Studio's Report a Problem feature. If you'd like the error message to be more meaningful, please report the issue at https://github.com/dotnet/NuGet.BuildTasks. I know it's confusing, but another team own that repo (which contains |
Beta Was this translation helpful? Give feedback.
-
I am trying to build the HostFx sample (https://github.com/dotnet/samples/tree/main/core/hosting)
but am getting the error below.
When opening the example I'm upgrading the Platform Toolset to v143 and the Windows SDK to 10.0.22621.1778
I have tried to clean the project, delete bin and obj folder and rebuild project with no result. Anyone know the reason and/or a possible solution?
Assembly loaded during TaskRun: Microsoft.NuGet.Build.Tasks, Version=17.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 (location: C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\NuGet\17.0\Microsoft.NuGet.Build.Tasks.dll, MVID: 7aa05f9d-a90d-4b04-8040-2d758974bac6, AppDomain: [Default])
1> Using "ResolveNuGetPackageAssets" task from assembly "C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\NuGet\17.0\Microsoft.NuGet.Build.Tasks.dll".
1> Task "ResolveNuGetPackageAssets"
1> Task Parameter:RuntimeIdentifier=win-x86
1> Task Parameter:IncludeFrameworkReferences=True
1> Task Parameter:
1> ContentPreprocessorValues=
1> rootnamespace
1> Value=NativeHost
1> assemblyname
1> Value=NativeHost.vs
1> fullpath
1> Value=C:\UE\hosting\src\NativeHost
1> outputfilename
1> Value=NativeHost.vs.exe
1> filename
1> Value=NativeHost.vs.vcxproj
1> Task Parameter:ContentPreprocessorOutputDirectory=Debug\NuGet
1> Task Parameter:ProjectLockFile=obj\project.assets.json
1> Task Parameter:ProjectLanguage=C++
1> Assembly loaded during TaskRun (Microsoft.NuGet.Build.Tasks.ResolveNuGetPackageAssets): Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed (location: C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\NuGet\17.0\Newtonsoft.Json.dll, MVID: f7499511-9334-484f-b6db-6825be2eac0d, AppDomain: [Default])
1> Assembly loaded during TaskRun (Microsoft.NuGet.Build.Tasks.ResolveNuGetPackageAssets): System.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 (location: C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll, MVID: 0cfb80c7-63d2-4fc1-af85-4f9d342b6d09, AppDomain: [Default])
1> C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\NuGet\17.0\Microsoft.NuGet.targets(198,5): error : Sequence contains no elements
1> C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\NuGet\17.0\Microsoft.NuGet.targets(198,5): error : at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
1> C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\NuGet\17.0\Microsoft.NuGet.targets(198,5): error : at Microsoft.NuGet.Build.Tasks.ResolveNuGetPackageAssets.GiveErrorForMissingFramework()
1> C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\NuGet\17.0\Microsoft.NuGet.targets(198,5): error : at Microsoft.NuGet.Build.Tasks.ResolveNuGetPackageAssets.GetTargetOrAttemptFallback(JObject lockFile, Boolean needsRuntimeIdentifier)
1> C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\NuGet\17.0\Microsoft.NuGet.targets(198,5): error : at Microsoft.NuGet.Build.Tasks.ResolveNuGetPackageAssets.GetReferences(JObject lockFile)
1> C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\NuGet\17.0\Microsoft.NuGet.targets(198,5): error : at Microsoft.NuGet.Build.Tasks.ResolveNuGetPackageAssets.ExecuteCore()
1> C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\NuGet\17.0\Microsoft.NuGet.targets(198,5): error : at Microsoft.NuGet.Build.Tasks.ResolveNuGetPackageAssets.Execute()
1> Done executing task "ResolveNuGetPackageAssets" -- FAILED.
Beta Was this translation helpful? Give feedback.
All reactions