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

[feature request] Ignore Directory.Build.props/targets from ancestor directories #701

Open
amis92 opened this issue Feb 14, 2023 · 2 comments

Comments

@amis92
Copy link

amis92 commented Feb 14, 2023

Currently, the dotnet restore {path}/script.csproj works with all standard dotnet and Microsoft.NET.Sdk defaults, however it being an implicit restore in a cached directory of which the user folder is often an ancestor can by accident cause import of files like Directory.Build.[props/targets].

I have spent a lot of time debugging lately why was project.assets.json file missing after a successful restore, and it turns out my repo has overridden the BaseIntermediateOutputPath ;)

@amis92
Copy link
Author

amis92 commented Feb 14, 2023

It's probably easiest to just create Directory.Build.props and .targets with <Project/> content as siblings of script.csproj.

@filipw
Copy link
Member

filipw commented Feb 15, 2023

Yes, that makes sense to me.

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

No branches or pull requests

2 participants