Closed zdavidsen closed 1 year ago
@zdavidsen Can you please provide the full error message? You cut off an important part of the message. The full error message should look something like this:
your.wixproj : error NU1201: Project WpfProject is not compatible with native (native,Version=v0.0) / win-x86. Project WpProject supports: net5.0-windows7.0 (.NETCoreApp,Version=v5.0)
I have the same issue. Here the full text in case OP doesn't provide his. C:\Repos\tems-platform\Tems\Setups\Ectn.Tems.TemsRecorderEmulatorInstaller\Ectn.Tems.TemsRecorderEmulatorInstaller.wixp roj : error NU1201: Project Ectn.Tems.TemsRecorderEmulator is not compatible with native (native,Version=v0.0). Project Ectn.Tems.TemsRecorderEmulator supports: net5.0-windows7.0 (.NETCoreApp,Version=v5.0)
Command: dotnet build .\Ectn.Tems.TemsRecorderEmulatorInstaller.wixproj -c Debug If build in VS, restore fails but build continues. msi file is being generated.
Pretty much same error that tstaec posted:
W:\WixModuleInstallTemplate\Code\Package\content\Code\Install\Install.wixproj : error NU1201: Project TemplateModuleInstantiator is not compatible with native (native,Version=v0.0). Project TemplateModuleInstantiator supports: net6.0-windows7.0 (.NETCoreApp,Version=v6.0)
Failed to restore W:\WixModuleInstallTemplate\Code\Package\content\Code\Install\Install.wixproj (in 1.17 sec).
1 of 2 projects are up-to-date for restore.
It's really easy to setup a failing case, you don't even need anything in the wpf or wix projs. (please excuse the powershell escape syntax)
mkdir wpf
mkdir install
cd wpf
dotnet new wpf
cd ../install
echo "<Project Sdk=`"WixToolset.Sdk/4.0.0-preview.1`">`n`t<ItemGroup><ProjectReference Include=`"../wpf/wpf.csproj`"/></ItemGroup>`n</Project>" > install.wixproj
dotnet restore
Incidentally, while writing that script I found out that dotnet add
complains about incompatible frameworks as well, presumably it's the same root cause?
@tstaec try adding the following snippet to your .wixproj:
<PropertyGroup>
<AssetTargetFallback>$(AssetTargetFallback);net5.0-windows7.0</AssetTargetFallback>
</PropertyGroup>
@zdavidsen try adding the following snippet to your .wixproj:
<PropertyGroup>
<AssetTargetFallback>$(AssetTargetFallback);net6.0-windows7.0</AssetTargetFallback>
</PropertyGroup>
Let me know if that work around works.
So that lets the restore complete, but it still says "1 of 2 projects are up-to-date for restore." I don't know if that's actually an issue yet, just wanted to chime back in quickly
Bugs
If this issue is a bug: