ResolveNuGetPackageAssets fails when packaging and application projects share a directory #8923
-
Failing minimal project here: https://github.com/SpareSimian/ResolveNuGetPackageAssetsIssue I just created a basic Hello World console app, added a "HeatWave project" (presumably really a Wix4 project, which was initially installed to a sibling directory and worked), and then moved the Wix4 project into the same directory as the sample console app. I edited the solution and WiX4 files to eliminate the "..\Package1". The result blows up with the errors below. I'm using VS2022 on Win10 x64 with WiX.exe 5.0.2+aa65968c. I have an ancient WiX 3 project I'm trying to update and I've been watching Rob's Deployment Dojo videos to make it happen. But I'm seeing this error in the application project which doesn't use any NuGet packages. I think the msbuild project synthesized from the solution file is injecting NuGet checks into the dependency. Sample output:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
.vcxproj is notoriously naive when it comes to NuGet integration and has not kept up with modern MSBuild concepts at all. Sdk-style projects are the perfect storm of newness to confuse .vcxproj. So, I'm not terribly surprised that it fails pretty spectacularly. In the end, don't mix your projects like that and definitely don't mix .vcxproj like that. Keep .vcxproj on the leaves of your build tree as much as possible. FWIW, I've never seen anyone merge projects like you have done here... and I've seen some pretty crazy things done with MSBuild. :) |
Beta Was this translation helpful? Give feedback.
-
It never occurred to me that projects need to be in different directories. This started back in the days of workspace and vsproj and probably WiX 2. Since the project files had different extensions, and different tooling, I figured, they'd just coexist, and they did. Only with WiX 4+ and the arrival of NuGet do I see this weirdness brought on by shared state in their common obj subdirectory. Oh, and I've always had the solution file in the same directory as the main application vcxproj, since VC6 days. I'm not opposed to moving all the installer projects to a sibling directory. (I have separate installers for each customer and for each supported compiler. Only one compiler version gets built, but all customer installers do. They differ in one configuration file that describes the physical product that the software controls.) |
Beta Was this translation helpful? Give feedback.
-
The one to worry about is CMake, as it's favored across platforms and even Visual Studio supports it. I'm trying to get up to speed with it by reading a thick tome from one of its developers. https://crascit.com/professional-cmake/ |
Beta Was this translation helpful? Give feedback.
.vcxproj is notoriously naive when it comes to NuGet integration and has not kept up with modern MSBuild concepts at all. Sdk-style projects are the perfect storm of newness to confuse .vcxproj. So, I'm not terribly surprised that it fails pretty spectacularly.
In the end, don't mix your projects like that and definitely don't mix .vcxproj like that. Keep .vcxproj on the leaves of your build tree as much as possible.
FWIW, I've never seen anyone merge projects like you have done here... and I've seen some pretty crazy things done with MSBuild. :)