dotnet / dotnet/project-system

"Prefer32Bit" property remains true when PlatformTarget is x64, but checkbox is empty and disabled.

Open
#5,933 2 comments 0 reactions 1 assignee Assigned to @melytc View on GitHub
Triage-Investigate
Dominant language
C#
Stars
1k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

**Visual Studio Version**: 16.2.3

**Summary**:

When setting a .NET Framework project's target to x64, the "Prefer32Bit" flag keeps its previous value, even if it was "true". This behavior seems to have changed at some point, because I have logic in custom build targets that rely on it being "false" if PlatformTarget is x64, and that logic was working previously (in Visual Studio 2017, at least).

![image](https://user-images.githubusercontent.com/8918977/75744351-d2519d00-5cc8-11ea-9948-9880d53a13bc.png)

It seems to retain this value in the project even though the checkbox is disabled. If I switch targets and uncheck it manually, then that setting persists.

![image](https://user-images.githubusercontent.com/8918977/75744393-f90fd380-5cc8-11ea-9b4c-e2c1695ce3d7.png)

**Expected Behavior**: PlatformTarget==x64 implies Prefer32Bit==false (or absent entirely from the project)

**Actual Behavior**: Prefer32Bit is treated as an entirely distinct property which doesn't adapt to PlatformTarget.

**User Impact**: Custom build targets relying on this property no longer work. In my case, 32-bit assets are deployed into x64 projects.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.