-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
don't unnecessarily require windows app ref package #11540
Conversation
4f53c1d
to
d7adcb6
Compare
@@ -2,7 +2,7 @@ | |||
<!-- The following properties enable target framework and dependency discovery when OS-specific workloads are required --> | |||
<PropertyGroup> | |||
<DesignTimeBuild>true</DesignTimeBuild> | |||
<EnableWindowsTargeting>true</EnableWindowsTargeting> | |||
<EnableWindowsTargeting Condition="$(TargetFramework.Contains('-windows'))">true</EnableWindowsTargeting> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the core of the fix
@@ -784,11 +784,11 @@ internal static async Task<ImmutableArray<string>> GetTargetFrameworkValuesFromP | |||
var targetsHelperPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "TargetFrameworkReporter.targets"); | |||
var (exitCode, stdOut, stdErr) = await ProcessEx.RunDotnetWithoutMSBuildEnvironmentVariablesAsync( | |||
[ | |||
"build", | |||
"msbuild", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this does a much simpler msbuild evaluation
if (framework.Framework == "_") | ||
{ | ||
// error/default value | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with the simpler msbuild eval, we need to explicitly handle an edge case
d7adcb6
to
57fb8c0
Compare
57fb8c0
to
57cde45
Compare
A private package source might not contain the
Microsoft.Windows.App.Ref
package so only setEnbleWindowsTargeting
when the TFM explicitly contains the string-windows
.