Skip to content

Fix MSB4019 error in ConPTY nupkg#20029

Merged
DHowett merged 1 commit intomicrosoft:mainfrom
gcrtnst:fix-conpty-nupkg
Mar 30, 2026
Merged

Fix MSB4019 error in ConPTY nupkg#20029
DHowett merged 1 commit intomicrosoft:mainfrom
gcrtnst:fix-conpty-nupkg

Conversation

@gcrtnst
Copy link
Copy Markdown
Contributor

@gcrtnst gcrtnst commented Mar 28, 2026

Summary of the Pull Request

This PR fixes the following error that occurs when attempting to use the Microsoft.Windows.Console.ConPTY nupkg in a Visual C++ project:

MSB4019: The imported project "C:\Microsoft.Windows.Console.ConPTY.props" was not found. Confirm that the expression in the Import declaration "$(MSBuildThisProjectDirectory)\..\Microsoft.Windows.Console.ConPTY.props", which evaluated to "\..\Microsoft.Windows.Console.ConPTY.props", is correct, and that the file exists on disk.

References and Relevant Issues

(None)

Detailed Description of the Pull Request / Additional comments

Based on the list of reserved and well-known properties, the property MSBuildThisProjectDirectory does not appear to exist. This PR replaces it with the correct property, MSBuildThisFileDirectory.

Validation Steps Performed

Verified that after applying this fix and packaging, the MSB4019 error no longer occurs. (Note: A different error now appears, but I will file a separate issue for that shortly.)

PR Checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated
    • If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated (if necessary)

Copy link
Copy Markdown
Member

@lhecker lhecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curiously, we're not the only ones using MSBuildThisProjectDirectory but it indeed doesn't seem documented.

@DHowett
Copy link
Copy Markdown
Member

DHowett commented Mar 30, 2026

Ugh. Good catch, thanks. Dunno how it worked before ;P

@DHowett
Copy link
Copy Markdown
Member

DHowett commented Mar 30, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@DHowett DHowett enabled auto-merge (squash) March 30, 2026 21:23
@github-project-automation github-project-automation bot moved this to To Cherry Pick in 1.25 Servicing Pipeline Mar 30, 2026
@github-project-automation github-project-automation bot moved this to To Cherry Pick in 1.24 Servicing Pipeline Mar 30, 2026
@DHowett DHowett merged commit be5dcf8 into microsoft:main Mar 30, 2026
14 of 16 checks passed
@DHowett DHowett moved this from To Cherry Pick to Cherry Picked in 1.24 Servicing Pipeline Mar 30, 2026
@DHowett DHowett moved this from To Cherry Pick to Cherry Picked in 1.25 Servicing Pipeline Mar 30, 2026
DHowett pushed a commit that referenced this pull request Mar 30, 2026
This commit fixes the following error that occurs when attempting to use the
`Microsoft.Windows.Console.ConPTY` nupkg in a Visual C++ project:

    MSB4019: The imported project "C:\Microsoft.Windows.Console.ConPTY.props" was not found.

Based on the list of reserved and well-known properties, the property
`MSBuildThisProjectDirectory` does not appear to exist.  This PR
replaces it with the correct property, `MSBuildThisFileDirectory`.

(cherry picked from commit be5dcf8)
Service-Card-Id: PVTI_lADOAF3p4s4BBcTlzgotQIo
Service-Version: 1.24
DHowett pushed a commit that referenced this pull request Mar 30, 2026
This commit fixes the following error that occurs when attempting to use the
`Microsoft.Windows.Console.ConPTY` nupkg in a Visual C++ project:

    MSB4019: The imported project "C:\Microsoft.Windows.Console.ConPTY.props" was not found.

Based on the list of reserved and well-known properties, the property
`MSBuildThisProjectDirectory` does not appear to exist.  This PR
replaces it with the correct property, `MSBuildThisFileDirectory`.

(cherry picked from commit be5dcf8)
Service-Card-Id: PVTI_lADOAF3p4s4BQX0-zgotQIk
Service-Version: 1.25
@gcrtnst gcrtnst deleted the fix-conpty-nupkg branch March 30, 2026 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Cherry Picked
Status: Cherry Picked

Development

Successfully merging this pull request may close these issues.

3 participants