Cannot load relative line numbers in Visual Studio 2017 enterprise

After installing extension relative line numbers in Visual Studio 2017 success, I opened a new project and found that the relative line number plugin is not loaded correcly.

Open logs in ActivityLog.xml I saw following error

<description>System.Runtime.InteropServices.COMException (0x80131163): 
Type library exporter encountered an error while processing &apos;
RelativeLineNumbers.OptionPageGrid.SaveSettingsToXml(writer), 
RelativeLineNumbers&apos;.
 Error: Type library exporter encountered an error while processing &apos;
Microsoft.VisualStudio.Shell.Interop.VSSAVETREEITEM.pHier, 
Microsoft.VisualStudio.Shell.Interop.8.0&apos;. 
Error: Type library exporter encountered an error while processing &apos;
Microsoft.VisualStudio.Shell.Interop.SVsSolutionObject, 
Microsoft.VisualStudio.Shell.Interop&apos;. 
Error: Type &apos;SVsSolutionObject&apos; 
and type &apos;SVsSolution&apos; 
both have the same UUID.&#x000D;&#x000A; 
at EnvDTE._DTE.get_Properties(String Category, String Page)&#x000D;&#x000A; 
at RelativeLineNumbers.RelativeLineNumbers..ctor(IWpfTextView textView, IEditorFormatMap formatMap, DTE dte)&#x000D;&#x000A; 
at RelativeLineNumbers.MarginFactory.CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)&#x000D;&#x000A; 
at Microsoft.VisualStudio.Text.Utilities.ContainerMargin.<AddMargins>b__25_1(IWpfTextViewMarginProvider mp)&#x000D;&#x000A; 
at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy`2 provider, Func`2 getter)&#x000D;&#x000A;
--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A; 
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)

 

You can fix this issue by reference this with a little revision

  • Launch “Developer Command Prompt for VS 2017” as Administrator
  • Go to VS 2017 installation folder cd C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise
  • gacutil -if Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.Shell.Interop.dll

 

key point is last line, Microsoft.VisualStudio.Shell.Interop.[8|11|12].0.dll won’t work for me.

Hope this helps, happy coding 🙂