Imported NuGet .targets causes additional project platforms to be displayed #1755
Labels
bug
Something isn't working
priority-low
We have considered this issue and decided that we will not be able to address it in the near future.
tracked
We are tracking this work internally.
Description
After installing the
Microsoft.Web.Webview2
NuGet package onto a C# class library (.NET Framework) project, Visual Studio will display additional project platforms that are not defined in the.csproj
.Default project platforms after creating project
![image](https://user-images.githubusercontent.com/7501210/134237062-c2695d18-ca92-4958-a829-a2d5d20c5dd4.png)
After installing NuGet package
![image](https://user-images.githubusercontent.com/7501210/134237080-0b723be3-1143-43a9-b41e-bca2bca9cabb.png)
Version
SDK: At least
1.0.705.50
ofMicrosoft.Web.Webview2
NuGet package or later (also confirmed with1.0.1018-prerelease
)Runtime: N/A?
Framework: Confirmed with a WPF application project/solution and a C# Wix Custom Action library
OS: Win10
Repro Steps
Microsoft.Web.Webview2
NuGet packageI expected no additional Platforms to show besides what are defined by my project. By installing the package and the import of the
.targets
, additional platforms show.Additional context
I believe this has to do with the setting of
EffectivePlatform
at the beginning ofCommon.targets
( automatically imported byMicrosoft.Web.WebView2.targets
)I believe by just checking for conditional platforms that don't exist in the project, it triggers the project UI to show them as possible options. This causes confusion of which platforms are actually available.
I removed these lines and the issue went away.
Honestly, it feels like it may be an issue with Visual Studio and the project structure, but maybe that's just how it works? Possibly the NuGet targets can add a conditional to the whole
PropertyGroup
since it's not even needed in the .NET project case.Thanks for reading/considering.
AB#36410393
The text was updated successfully, but these errors were encountered: