Open AdamBraden opened 1 year ago
Additional note:
\build\Microsoft.WindowsAppSDK.props
and \build\Microsoft.WindowsAppSDK.targets
(as well as buildTransitive\*
) needs to be moved to subfolders net6.0-windows10.0.xxxxx
and native
, so that the app sdk is only getting included into the project types that actually support the windows app sdk. (the rest of the files can be in a shared folder and just referenced with a relative path, which might also help avoiding all the duplication in build and buildTransitive folders).
Instead of putting it in netcoreapp
folder, you might want to put the build error in netstandard1.0
so other projects like .NET Framework and .net standard libraries will also get the build error.
.NET developers can set TFM to net6.0 and net6.0-windows. If they then add a nuget reference to the WinAppSDK, the build will succeed, but the winappsdk will not be referenced, leading to developer confusion.
A way around this is to add a ResolveAssemblyReferences target that raises an error for netcoreapp as a fallback.
Thanks to @dotmorten for pointing this technique out. Approach is similar to this PR: https://github.com/dotnet/reactive/pull/1442/files