Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8324679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:09:38+00:00 2026-06-09T00:09:38+00:00

Using Roslyn’s Workspaces, is there any way to acquire a hook into the active

  • 0

Using Roslyn’s Workspaces, is there any way to acquire a hook into the active IWorkspace provided by Visual Studio?

I want to be able to open ExampleProject in Visual Studio, then in my own application, I want to open ExampleProject again via Roslyn.Services.Workspace, but only for purposes of monitoring file/code changes that are produced in Visual Studio. I ran a hopeful test of just loading the project into a Workspace, and hoping it would magically pick up changes from disk somehow, but no such luck.

Which leaves the only possibilities being;

  1. Get a reference to the current loaded Workspace directly from Visual
    Studio. I don’t know if VS even exposes this across process
    boundaries, or how to find out.

  2. Rework my entire project as a Visual Studio Extension, where I
    would have automatic access to the open Workspace. I’d prefer not
    to dive into building an Extension right now.

Here’s some code I’m using to test:

public class ProjectDiskMonitor
{
    public ProjectDiskMonitor(string fullProjectPath)
    {
        WS = Workspace.LoadStandAloneProject(fullProjectPath, null, null, null, true) as Workspace;
        WS.WorkspaceChanged += new EventHandler<WorkspaceEventArgs>(TargetProjectChanged);
//this event is not being fired as I edit the project via another instance of VS

    }

    private void TargetProjectChanged(object sender, WorkspaceEventArgs e)
    {
        Console.WriteLine("Project changed");
    }

    private Workspace WS
    {
        get;
        set;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:09:39+00:00Added an answer on June 9, 2026 at 12:09 am

    If you are calling Workspace.LoadSolution() to get the workspace, pass “true” to enableFileTracking parameter of LoadSolution and it’ll automatically listen to the filesystem and pick up changes. Don’t forget that ISolution instances are immutable, so to get new state you’ll have to access the CurrentSolution property on the Workspace to get the updated state.

    There’s no current way to get an IWorkspace from Visual Studio in a cross-process manner, or at least not without you building your own remoting protocol.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Microsoft SQL Server 2005, is there any way to see when a table
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
Using SQL Server 2008 R2 we are looking for a way to select the
Using android 2.3.3, I have a background Service which has a socket connection. There's
I have a Visual Studio package that does some of its work by starting
Using mercurial, I've run into an odd problem where a line from one committer
I'm generating a Greeter.dll using the Roslyn compiler. My problem occurs trying to load
I would like to perform reflection style operations on the following class using Roslyn:
Using online interfaces to a version control system is a nice way to have
Using ASP.NET MVC there are situations (such as form submission) that may require a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.