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

Problem when PlatformTarget is omitted from .csproj #5901

Open
vsfeedback opened this issue Feb 18, 2020 · 2 comments
Open

Problem when PlatformTarget is omitted from .csproj #5901

vsfeedback opened this issue Feb 18, 2020 · 2 comments
Assignees
Labels
Bug This is a functional issue in already written code. Feature-Legacy-Application-Designer The "Application Designer" otherwise known as the legacy project properties Triage-Approved Reviewed and prioritized
Milestone

Comments

@vsfeedback
Copy link

vsfeedback commented Feb 18, 2020

This issue has a corresponding ticket on Developer Community. Please vote and comment there to make sure your voice is heard.


This is a problem when using .NET Framework with .csproj in SDK-style.

If you omit <PlatformTarget>, the target platform will be displayed as "x86" in the GUI project settings, but it will be executed in 64bit.

I think "AnyCPU" is the correct.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net472</TargetFramework>
  </PropertyGroup>

</Project>
  • Windows 10 64bit
  • Visual Studio Community 2019 Version 16.4.4
@jjmew jjmew added Bug This is a functional issue in already written code. Feature-Legacy-Application-Designer The "Application Designer" otherwise known as the legacy project properties Triage-Approved Reviewed and prioritized labels Feb 18, 2020
@jjmew jjmew added this to the 16.7 milestone Feb 18, 2020
@jjmew jjmew added Triage-Investigate Reviewed and investigation needed by dev team and removed Triage-Approved Reviewed and prioritized labels Feb 18, 2020
@davkean davkean removed the Triage-Investigate Reviewed and investigation needed by dev team label Jun 23, 2020
@davkean
Copy link
Member

davkean commented Jun 23, 2020

Removing Triage markings, this wasn't assigned to anyone.

@jjmew jjmew removed this from the 16.7 milestone Jun 23, 2020
@jjmew jjmew added the Triage-Approved Reviewed and prioritized label Jun 26, 2020
@jjmew jjmew added this to the 16.x milestone Jun 26, 2020
@drewnoakes drewnoakes modified the milestones: 16.x, 17.x Oct 6, 2021
@drewnoakes
Copy link
Member

The above project shows this in the new Project Properties UI:

image

Looking at a design-time build, I see that PlatformTarget is evaluated as x86 and changed to AnyCPU in target AdjustDefaultPlatformTargetForNetFrameworkExeWithNoNativeCopyLocalItems.

https://github.com/dotnet/sdk/blob/6c5d3376a4f581090be1f8cd453907166209fe4f/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets#L241-L257

It seems we're currently getting this value from evaluation, but need it from build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a functional issue in already written code. Feature-Legacy-Application-Designer The "Application Designer" otherwise known as the legacy project properties Triage-Approved Reviewed and prioritized
Projects
None yet
Development

No branches or pull requests

5 participants