How do you create a VS single file generator with Roslyn

490 views Asked by At

I am trying to create a single file generator with Roslyn running with /rootsuffix Roslyn, but the usual IVsSingleFileGenerator does not seem to work - I cannot even hit a breakpoint in it. What should I do?

2

There are 2 answers

2
Andrew Arnott On

How are you arranging to install your VS extension into the Roslyn hive? By default building a VSIX and debugging from VS installs the VSIX into the Exp hive. That might be why your single file generator isn't being created.

5
SLaks On

To make your extension automatically deploy to the Roslyn hive, open your csproj file, and add <VSSDKTargetPlatformRegRootSuffix>roslyn</VSSDKTargetPlatformRegRootSuffix>.

However, you don't actually need the Roslyn hive at all.

On VS2013, the Roslyn preview installed itself to the Roslyn hive. However, Dev14 always uses Roslyn, regardless in every hive (Roslyn completely replaces the native language services).