sdk: Default platform target in Properties window is incorrect
From @davidmatson on August 28, 2017 19:40
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net47</TargetFramework>
</PropertyGroup>
</Project>
using System;
using System.Reflection;
class Program
{
static void Main(string[] args)
{
Console.WriteLine(Environment.Is64BitProcess);
ImageFileMachine b;
typeof(Program).Assembly.ManifestModule.GetPEKind(out PortableExecutableKinds a, out b);
Console.WriteLine($"{a}: {b}");
}
}
Actual output:
True
ILOnly: I386
But, properties window shows:

Copied from original issue: dotnet/project-system#2744
About this issue
- Original URL
- State: open
- Created 7 years ago
- Reactions: 3
- Comments: 29 (22 by maintainers)
Commits related to this issue
- Nuget - Remove SDK Style project workaround for not PlatformTarget specified - Remove the workound as it's not working (behaviour is different depending on the SDK version installed) - Add Prefer32Bi... — committed to cefsharp/CefSharp by amaitland 3 years ago
- Nuget - Remove SDK Style project workaround for not PlatformTarget specified - Remove the workound as it's not working (behaviour is different depending on the SDK version installed) - Add Prefer32Bi... — committed to cefsharp/CefSharp by amaitland 3 years ago
- Nuget - Sdk Style Project targeting AnyCPU generate error when PlatformTarget not set When targeting AnyCPU with an SDK Style project PlatformTarget will default to x86 before build and after build i... — committed to cefsharp/CefSharp by amaitland 3 years ago
- Nuget - Sdk Style Project targeting AnyCPU generate error when PlatformTarget not set When targeting AnyCPU with an SDK Style project PlatformTarget will default to x86 before build and after build i... — committed to cefsharp/CefSharp by amaitland 3 years ago
From @tannergooding on August 28, 2017 21:1
You can workaround the issue for the time being by explicitly specifying
<PlatformTarget>AnyCPU</PlatformTarget>in your project file.@davkean, based on last comment, I was able to make the platform target set to x64 by explicitly setting all platform-like properties for net462 xunit project:
then in SLN, added x64 configurations like this:
After that, property page shows only one option:
Platform: Active (x64)(which was the desired behavior)