Skip to content
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

Merged
merged 5 commits into from
Nov 4, 2019
Merged

Fix error message #4849

merged 5 commits into from
Nov 4, 2019

Conversation

Forgind
Copy link
Member

@Forgind Forgind commented Oct 24, 2019

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.

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.
Copy link
Member

@rainersigwald rainersigwald left a 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>
Copy link
Member

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>
Copy link
Member

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.
src/Tasks/Microsoft.Common.CurrentVersion.targets Outdated Show resolved Hide resolved
src/Tasks/Microsoft.Common.CurrentVersion.targets Outdated Show resolved Hide resolved
Forgind and others added 2 commits November 4, 2019 10:15
Co-Authored-By: Rainer Sigwald <raines@microsoft.com>
Co-Authored-By: Rainer Sigwald <raines@microsoft.com>
@Forgind Forgind merged commit 80a1c07 into dotnet:master Nov 4, 2019
@Forgind Forgind deleted the COM-reference branch January 16, 2020 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confusing error when using COMReference on Core
2 participants