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

Add hook to MSBuild for importing target after Directory.Build.props file #8876

Closed
dsplaisted opened this issue Jun 13, 2023 · 1 comment · Fixed by #8877
Closed

Add hook to MSBuild for importing target after Directory.Build.props file #8876

dsplaisted opened this issue Jun 13, 2023 · 1 comment · Fixed by #8877
Labels

Comments

@dsplaisted
Copy link
Member

For the Artifacts Output Format, the .NET SDK needs to add MSBuild logic to be evaluated immediately after any Directory.Build.props file is imported. In order to do this, it is currently importing Directory.Build.props itself and disabling the import from the common targets: https://github.com/dotnet/sdk/blob/d1773f68a8bbdaa7e2228a7f2f8f0ac341dfd65b/src/Tasks/Microsoft.NET.Build.Tasks/sdk/Sdk.props#L37-L58

Instead of repeating the MSBuild logic in the SDK, we could add a hook to MSBuild to allow the SDK to specify a file to be imported directly after the Directory.Build.props file. Probably this would involve adding the following line here:

 <Import Project="$(AfterDirectoryBuildPropsImport)" Condition="$(AfterDirectoryBuildPropsImport) != ''" />
@dsplaisted
Copy link
Member Author

@Forgind, could you look at doing this for VS 17.7, and then once it ships updating the .NET SDK logic to take advantage of it?

FYI @marcpopMSFT @donJoseLuis

JaynieBai pushed a commit that referenced this issue Jun 16, 2023
Fixes #8876

Context
The SDK has logic it wants to run immediately after importing Directory.Build.props. This adds a hook for that so the SDK doesn't have to manually import it, disable importing Microsoft.Common.props, then re-implement part of it.
@AR-May AR-May added the triaged label Feb 21, 2024
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