Is it possible to hook into the Roslyn build process during a Visual Studio/TFS build, and if yes, is it possible to get a hold of the Microsoft.CodeAnalysis.Solution/Microsoft.CodeAnalysis.Project instance being used by Roslyn during compilation?
Hook into the Roslyn build process
1.4k Views Asked by dotarj At
1
There are 1 best solutions below
Related Questions in C#
- How to define WIX agent requirement in TeamCity?
- Reading msbuild syntax
- Release Management for Visual Studio 2013 - Release Exception
- Exception in SonarQube.Msbuild.Runner
- How to build rptproj using C#
- Can't build a project with Postsharp 4.1.14
- Migrate ClickOnce certificate from Sha1 to SHA256 and run on .NET 4.0 client machines
- Run MSBuild from powershell without specifying .Net version
- hosted build visual studio online
- WebDeploy from TFS using Build Definitions to IIS site containing files changed by users
Related Questions in MSBUILD
- How to define WIX agent requirement in TeamCity?
- Reading msbuild syntax
- Release Management for Visual Studio 2013 - Release Exception
- Exception in SonarQube.Msbuild.Runner
- How to build rptproj using C#
- Can't build a project with Postsharp 4.1.14
- Migrate ClickOnce certificate from Sha1 to SHA256 and run on .NET 4.0 client machines
- Run MSBuild from powershell without specifying .Net version
- hosted build visual studio online
- WebDeploy from TFS using Build Definitions to IIS site containing files changed by users
Related Questions in ROSLYN
- How to define WIX agent requirement in TeamCity?
- Reading msbuild syntax
- Release Management for Visual Studio 2013 - Release Exception
- Exception in SonarQube.Msbuild.Runner
- How to build rptproj using C#
- Can't build a project with Postsharp 4.1.14
- Migrate ClickOnce certificate from Sha1 to SHA256 and run on .NET 4.0 client machines
- Run MSBuild from powershell without specifying .Net version
- hosted build visual studio online
- WebDeploy from TFS using Build Definitions to IIS site containing files changed by users
Related Questions in MSBUILD-TASK
- How to define WIX agent requirement in TeamCity?
- Reading msbuild syntax
- Release Management for Visual Studio 2013 - Release Exception
- Exception in SonarQube.Msbuild.Runner
- How to build rptproj using C#
- Can't build a project with Postsharp 4.1.14
- Migrate ClickOnce certificate from Sha1 to SHA256 and run on .NET 4.0 client machines
- Run MSBuild from powershell without specifying .Net version
- hosted build visual studio online
- WebDeploy from TFS using Build Definitions to IIS site containing files changed by users
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The way I see it, Jon is pretty much right in his comment. What I would suggest is to create an MSBuild task, which is your wanted hook into the build process.
Create an MSBuild project file (you've probably seen them already, it's those files that have the
.targets
extension). It looks something like this:The attribute in the "MyNamespace.MyReferenceValidationTask" tag "SolutionRoot" is your property in your task. All the macros that are available in Visual Studio are also available here. (see this post here: https://stackoverflow.com/a/1453023/978594)
What you do inside of the task is entirely up to you. You can, for example, load your solution file with Roslyn and thus have all the projects and their references and do your desired validation.