Cannot find an instance of the Microsoft.VisualStudio.Shell.Interop.IVsToolsOptions service while accesing options page values in vsix project

Siddhi Kamat 1 Reputation point
2021-08-12T11:43:58.943+00:00

I am getting the following exception when I try to access the Option page textbox values in vsix project.

{"Cannot find an instance of the Microsoft.VisualStudio.Shell.Interop.IVsToolsOptions service."} Microsoft.Assumes.InternalErrorException

127895-capture.png

127882-capture1.png

Preferences.cs code which inherits DialogPage

using Microsoft.VisualStudio.Shell;  
using System.ComponentModel;  
using System.Runtime.InteropServices;  
using Microsoft.VisualStudio.Shell.Interop;  
using System;  
  
namespace Code_Forensics  
{  
    [Guid("00000000-0000-0000-0000-000000000000")]  
    [ClassInterface(ClassInterfaceType.AutoDual)]  
    [ComVisible(true)]  
    public class Preferences : DialogPage  
    {  
        private PreferencesControl _control;  
  
        public string ResultStoreFolder { get; set; }  
        public string PollingInterval { get; set; }  
  
        protected override System.Windows.Forms.IWin32Window Window  
        {  
            get  
            {  
                _control = new PreferencesControl();  
                _control._controlpage = this;  
                _control.ResultStoreFolder = ResultStoreFolder;  
                _control.PollingInterval = PollingInterval;  
                return _control;  
            }  
        }  
        protected override void OnApply(DialogPage.PageApplyEventArgs e)  
        {  
            if (e.ApplyBehavior == ApplyKind.Apply)  
            {  
                ResultStoreFolder = _control.ResultStoreFolder;  
                PollingInterval = _control.PollingInterval;  
            }  
            base.OnApply(e);  
        }  
    }  
}  
  

I tried this solution but didnt work
https://developercommunity.visualstudio.com/t/cannot-find-an-instance-of-the-microsoftvisualstud-1/664792

122766-image.png

Can anyone help me with this?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
40,167 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 30,101 Reputation points Microsoft Vendor
    2021-08-20T09:27:43.353+00:00

    Hi @Siddhi Kamat ,

    Please run the following command to add the “Microsoft.VisualStudio.Shell.Interop.8.0.dll” assembly and try again:
    gacutil -i Microsoft.VisualStudio.Shell.Interop.8.0.dll

    Sincerely,
    Anna

    • If the answer 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.