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
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
Can anyone help me with this?