Intercept Roslyn build process to generate files and add them to output #68940
Unanswered
GlobyteNet
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wanted to create a tool that inspects ASP.NET application and generates some html and js code. At first I thought that using incremental generator is the right way to do it but I soon realized it cannot generate files other than C#. I know I can run custom task during msbuild process. However I don't know how I can acquire Solution object to inspect it (that was created during build process by roslyn). I know I can use workspace.OpenProjectAsync, but rebuilding the project second time seems like a waste of resources. Ideally it would look like Incremental generator where I receive built instance of Solution or Project or Compilation. So my question is: How can I efficiently inspect Solution and SyntaxTrees while build process is going and (ideally) how can I imporve user experience by adding some information to IntelliSense when user is typing something in JavaScript file? Do I need Roslyn API, MSBuild API, Visual Studio Extension or something else?
Beta Was this translation helpful? Give feedback.
All reactions