Is it possible to host Visual Studio Editor in C# WPF app ?

SagarKardani-9773 5 Reputation points
2023-06-26T07:08:40.3566667+00:00

I want to host Visual Studio editor in a WPF app. Is it possible ? Is Visual Studio Editor is available in such a way that it can be integrated in a WPF app ? Currently I have achieved the requirement via integrating AvalonEdit. It is working fine but having some issues and I want some more sophisticated editor that is written in C#.

Developer technologies | Windows Presentation Foundation
{count} votes

1 answer

Sort by: Most helpful
  1. Hui Liu-MSFT 48,681 Reputation points Microsoft External Staff
    2023-06-28T03:31:29.6566667+00:00

    Hi,@Sagar Kardani.Welcome Microsoft Q&A.

    Yes, it is possible to host the Visual Studio editor in a WPF app using the Microsoft.VisualStudio.Editor namespace and related libraries. This allows you to integrate the Visual Studio editor functionality into your own application. It's more complicated, you could check out the attempt here.

    You can also try to consider using the Roslyn-based code editor called "RoslynPad." RoslynPad is a lightweight C# IDE that provides a rich editing experience and utilizes the Roslyn compiler platform.

    RoslynPad is also open-source, and you can find its repository on GitHub. It offers advanced features like syntax highlighting, code completion, error checking, and more. You can explore its source code and integrate it into your WPF application. Keep in mind that integrating RoslynPad will require some additional effort and customization based on your specific requirements.


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.