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

Targets in Directory.Build.targets or .props not shown #69

Open
solvingj opened this issue Dec 28, 2020 · 8 comments
Open

Targets in Directory.Build.targets or .props not shown #69

solvingj opened this issue Dec 28, 2020 · 8 comments
Milestone

Comments

@solvingj
Copy link

If a custom target is defined in either of the following implicitly imported files, it does not appear in MsBuildTaskExplorer

  • Directory.Build.targets
  • Directory.Build.props

If instead, I move the target definition to a separate .targets file and import that targets file in Directory.Build.targets, it is shown properly.

@Serg046
Copy link
Owner

Serg046 commented Dec 28, 2020

Where are those files located? MsBuildTaskExplorer scans the solution folder only.

@solvingj
Copy link
Author

They're outside the solution folder. That explains the issue.

@Serg046
Copy link
Owner

Serg046 commented Dec 29, 2020

@solvingj if MsBuild itself understands your files in that folder, maybe it is worth scanning that (and similar ones) folder as well. Just let me know if you are interested in that and we can support it somehow.

@solvingj
Copy link
Author

Thanks for taking an interest. If you haven't read about them already, here's an overview of the files I was using:

https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2019

It does probably make sense to support them if it's not too difficult.

@Serg046 Serg046 reopened this Dec 29, 2020
@Serg046
Copy link
Owner

Serg046 commented Dec 29, 2020

Thanks for the link, looks like we should go to the root level by level

c:\users\username\code\test\case1
c:\users\username\code\test
c:\users\username\code
c:\users\username
c:\users
c:\

@solvingj
Copy link
Author

Yes that seems like one way you could approach it. To be honest though, I'm surprised there's no internal project API for enumerating all loaded targets regardless of the props file they're in, and/or enumerating all props file's that have been loaded during evaluation phase. If you haven't looked for such a thing already, perhaps consider it.

@Serg046
Copy link
Owner

Serg046 commented Dec 30, 2020

I totally agree, I even thought that we do something like that but based on what I saw, when I was checking, we just look for the files manually. Thank you for highlighting it, hope there is a way to do it like you said.

@solvingj
Copy link
Author

thanks for all your hard work!

@Serg046 Serg046 added this to the 2.0 milestone Apr 8, 2021
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