My package did not load. How can I interpret the activity log

155 Views Asked by At

My VSPackage did not load correctly into Visual Studio 2019 for one user.

The user has sent me part of the activity log:

<entry>
  <record>2206</record>
  <time>2019/12/13 10:44:12.579</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>Begin package load [MultiLanguagePackage]</description>
  <guid>{8FA8895A-868F-4319-82FD-A4805D8953CE}</guid>
</entry>

<entry>
  <record>2207</record>
  <time>2019/12/13 10:44:12.616</time>
  <type>Error</type>
  <source>VisualStudio</source>

  <description>SetSite failed for package [MultiLanguagePackage]
  Source: 'Microsoft.VisualStudio.Shell.15.0'; 
  Description: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
  System.NullReferenceException: 
  Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.   
  bei Microsoft.VisualStudio.Shell.DialogPage.SetPropertyValue(PropertyDescriptor descriptor, Object automationObject, Object value)   
  bei Microsoft.VisualStudio.Shell.DialogPage.LoadSettingFromStorage(PropertyDescriptor prop)   
  bei Microsoft.VisualStudio.Shell.DialogPage.LoadSettingsFromStorage()   
  bei Microsoft.VisualStudio.Shell.DialogPage.set_Site(ISite value)   
  bei System.ComponentModel.Container.Add(IComponent component, String name)   
  bei System.ComponentModel.Container.Add(IComponent component)   
  bei Microsoft.VisualStudio.Shell.Package.GetDialogPage(Type dialogPageType)   
  bei MultiLangServices.SettingsService.InitOptionsPages(Package p) in C:\VSPackage_Version_7_1\Project\MultiLangServices\Services\SettingsService.cs:Zeile 24.   
  bei MultiLanguage2019.MultiLanguagePackage.&lt;InitializeAsync&gt;d__2.MoveNext()
  --- Ende der Stapel&#x00FC;berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel&#x00F6;st wurde ---   
  bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)   
  bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)   
  bei Microsoft.VisualStudio.Shell.AsyncPackage.&lt;&gt;c__DisplayClass20_0.&lt;&lt;Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize&gt;b__1&gt;d.MoveNext()
  --- Ende der Stapel&#x00FC;berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel&#x00F6;st wurde ---   
  bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)   
  bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)   
  bei Microsoft.VisualStudio.Shell.UIThreadReentrancyScope.WaitOnTaskCompleteInternal(Task task, CancellationToken cancel, Int32 ms)   
  bei Microsoft.VisualStudio.Services.VsTask.&lt;&gt;c__DisplayClass100_1.&lt;InternalGetResult&gt;b__1()   
  bei Microsoft.VisualStudio.Services.VsTask.IgnoreObjectDisposedException(Action action)   
  bei Microsoft.VisualStudio.Services.VsTask.&lt;&gt;c__DisplayClass100_0.&lt;InternalGetResult&gt;b__0()   
  bei Microsoft.VisualStudio.Services.VsTask.&lt;&gt;c__DisplayClass108_0.&lt;InvokeWithWaitDialog&gt;b__0()   
  bei Microsoft.VisualStudio.Services.VsTask.InvokeWithWaitDialog[T](Func`1 function)   
  bei Microsoft.VisualStudio.Services.VsTask.InvokeWithWaitDialog(Action action)   
  bei Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck)   
  bei Microsoft.VisualStudio.Services.VsTask.GetResult()</description>

  <guid>{8FA8895A-868F-4319-82FD-A4805D8953CE}</guid>
  <hr>80004003 - E_POINTER</hr>
  <errorinfo></errorinfo>
</entry>

<entry>
  <record>2208</record>
  <time>2019/12/13 10:44:12.618</time>
  <type>Error</type>
  <source>VisualStudio</source>
  <description>End package load [MultiLanguagePackage]</description>
  <guid>{8FA8895A-868F-4319-82FD-A4805D8953CE}</guid>
  <hr>80004003 - E_POINTER</hr>
  <errorinfo></errorinfo>
</entry>

How can I interpret this information?
Does it contain any useful pointer to the cause of the error?

My package contains a reference to the NuGet package Micorosft.VisualStudio.SDK version 16.0.202.

It does not contain a specific reference to Microsoft.VisualStudio.Shell.15.0

1

There are 1 best solutions below

1
Matze On BEST ANSWER

I assume that the MultiLanguageService class belongs to your package implementation - it is doing something that causes a NullReferenceException. Such error should be easy to locate; the stack trace tells you that something is going wrong in MultiLangServices.SettingsService.InitOptionsPages(Package p) in ...SettingsService.cs:Zeile 24. Just put a breakpoint to line 24 and verify if everything behaves as expected.

I don´t think that it is related to a certain SDK-package or -assembly that you´ve referenced. If the code works for the majority of the users, there must be something in the code that may fail under certain circumstances; for instance, a configuration value that results in the reported NullReferenceException exception, if missing. I would inspect the implementation and at least add a proper exception handler so that, next time, a more precise error will be reported to the activity-log.