Can I access MsBuildWorkspace from the MsBuild task class?

As I understand it, Roslin introduced the concept of Workspaces. One implementation of workspaces is MsBuildWorkspace.

My question is: can I get access to the Roslyn workspace representing the constructed project from the custom build task?

I suspect this is the goal of MsBuildWorkspace. If so, can I access this workspace from a method Executein my user task (derived from Microsoft.Build.Utilities.Task)?

In case you are wondering why, I need to go through other aspects of the project that is being built. It’s not enough for me to have access to a specific input file of the task to generate output.

+2
source share
1 answer

, MsBuildWorkspace

.
MsBuildWorkspace MSBuild Roslyn.

MSBuild ( MSBuild) Roslyn ( #, Roslyn), MsBuildWorkspace, .

MsBuildWorkspace .

+2

All Articles