Is there a way to get a path to .csproj
file in file watcher? I want to create a watcher that will launch third-party app with this argument. There is plenty of different macros (like solutionPath etc) but I didn't find what I need.
Asked
Active
Viewed 282 times
0

Crabar
- 1,829
- 1
- 14
- 26
2 Answers
1
Try to add a new custom tool, there are some project-related macros there:
File | Settings | Tools | Custom Tools

xtmq
- 3,380
- 22
- 26
-
I'm not sure I understand you. I'm trying to create a new watcher in a file watcher tool. And I need to pass a path to the current csproj file. But I have no clue how to get it dynamically. – Crabar Mar 28 '19 at 12:33
-
You can setup custom tool instead of file watcher tool. Basically they do the same, but custom tools working inside R# part of Rider. While file watchers works on IDEA side... – xtmq Mar 29 '19 at 09:07
-
My goal was to launch a third-party app on files changes automatically and pass it needed arguments. As I see I cannot do it via Custom tools, but correct me if I wrong. – Crabar Mar 29 '19 at 09:14
-
Why you can not do that? – xtmq Mar 29 '19 at 09:21
-
I have added an image to the answer – xtmq Mar 29 '19 at 09:21
-
Thank you for further explanation. I feel stupid, but I still don't understand how to configure to run this tool automatically on files changes? – Crabar Mar 29 '19 at 09:31
-
It should be executed on every file change (ctrl+s or autosave) for files with specified extension) if it does not - probably you have found a bug in Rider =) – xtmq Mar 29 '19 at 11:10
0
I didn't find a simple way, so I ended up with a python script. It finds a file path with some regexps specific to my project. And I have added a custom file watcher that launches this script when needed.

Crabar
- 1,829
- 1
- 14
- 26