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

ProjectReference Platform Negotiation - Pass Platform Instead of PlatformTarget #6887

Closed
benvillalobos opened this issue Sep 24, 2021 Discussed in #6871 · 0 comments · Fixed by #6889
Closed

ProjectReference Platform Negotiation - Pass Platform Instead of PlatformTarget #6887

benvillalobos opened this issue Sep 24, 2021 Discussed in #6871 · 0 comments · Fixed by #6889
Labels

Comments

@benvillalobos
Copy link
Member

Discussed in #6871

Originally posted by jhennessey September 20, 2021
I'm trying to make use of the new ProjectReference SetPlatform Negotiation feature. After performing all of the documented steps to enable the feature, I could not get a simplistic two project (non-SDK style) build to work correctly. In this case, NetFx.Library2 (x86/x64) referenced NetFx.Library1 (AnyCPU). When attempting to build, it would result with the following error:

(_CheckForInvalidConfigurationAndPlatform target) -> c:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(820 ,5): error : The BaseOutputPath/OutputPath property is not set for project 'NetFx.Library1.csproj'. Please check to ma ke sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='x64'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.

After exploring the logs and associated code changes for the feature, I could see that PlatformTarget was being passed to the referenced project here. That doesn't appease the referenced project because it uses Platform for its defined configurations. However, if I change the referenced code to pass Platform (along with PlatformTarget) my build works as expected.

Is there any reason why Platform can't also be passed to the referenced projects?

#5338
#6655

Logs:
error.log
success.log

Summarized

The long and the short of it: We should be passing Platform= instead of PlatformTarget=. There also needs to be an investigation as to whether or not we need to remove the use of PlatformTarget within the feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants