-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix error message #4849
Fix error message #4849
Conversation
If the platform target is explicitly set to x86, it sets the MSBuild architecture to the same. It then passes over the real problem when using dotnet build and returns a confusing error message instead.
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.
I don't think this is the right fix. I was envisioning something along the lines of checking $(MSBuildRuntimeType)
and if it's Core
forcing use-the-current-platform.
@@ -504,7 +504,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. | |||
<PlatformTargetAsMSBuildArchitectureExplicitlySet Condition="'$(PlatformTargetAsMSBuildArchitecture)' != ''">true</PlatformTargetAsMSBuildArchitectureExplicitlySet> | |||
<PlatformTargetAsMSBuildArchitectureExplicitlySet Condition="'$(PlatformTargetAsMSBuildArchitecture)' == ''">false</PlatformTargetAsMSBuildArchitectureExplicitlySet> | |||
|
|||
<PlatformTargetAsMSBuildArchitecture Condition="'$(PlatformTarget)' == 'x86' or ('$(PlatformTarget)' == 'x64' and '$(MSBuildExtensionsPath64)' != '')">$(PlatformTarget)</PlatformTargetAsMSBuildArchitecture> | |||
<PlatformTargetAsMSBuildArchitecture Condition="('$(PlatformTarget)' == 'x86' and '$(MSBuildExtensionsPath86)' != '') or ('$(PlatformTarget)' == 'x64' and '$(MSBuildExtensionsPath64)' != '')">$(PlatformTarget)</PlatformTargetAsMSBuildArchitecture> |
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.
Where did you get MSBuildExtensionsPath86
from? I don't see it when grepping through the repo.
@@ -507,7 +507,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. | |||
<PlatformTargetAsMSBuildArchitecture Condition="'$(PlatformTarget)' == 'x86' or ('$(PlatformTarget)' == 'x64' and '$(MSBuildExtensionsPath64)' != '')">$(PlatformTarget)</PlatformTargetAsMSBuildArchitecture> | |||
<PlatformTargetAsMSBuildArchitecture Condition="'$(PlatformTarget)' == 'arm'">x86</PlatformTargetAsMSBuildArchitecture> | |||
<PlatformTargetAsMSBuildArchitecture Condition="('$(PlatformTarget)' == 'ia64' and '$(MSBuildExtensionsPath64)' != '')">x64</PlatformTargetAsMSBuildArchitecture> | |||
<PlatformTargetAsMSBuildArchitecture Condition="'$(PlatformTargetAsMSBuildArchitecture)' == ''">CurrentArchitecture</PlatformTargetAsMSBuildArchitecture> | |||
<PlatformTargetAsMSBuildArchitecture Condition="'$(MSBuildRuntimeType)' == 'Core' or '$(PlatformTargetAsMSBuildArchitecture)' == ''">CurrentArchitecture</PlatformTargetAsMSBuildArchitecture> |
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.
Would it make sense to elevate this condition to the whole PropertyGroup? I feel like "running on Core which doesn't support taskhosts" and DisableOutOfProcTaskHost
are pretty close. It looks like that property doesn't get directly set anywhere, so we can't just condition at its definition.
ResolveComReferences target owners explicitly said they would not port it to .NET Core and others (so far) haven't either. This clarifies the error message for all such targets.
Co-Authored-By: Rainer Sigwald <raines@microsoft.com>
Co-Authored-By: Rainer Sigwald <raines@microsoft.com>
If the platform target is explicitly set to x86, it sets the MSBuild architecture to the same. It then passes over the real problem when using dotnet build and returns a confusing error message instead. Fixes #4332.