codecadwallader / codemaid

CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.
http://www.codemaid.net
GNU Lesser General Public License v3.0
1.88k stars 352 forks source link

Unable to run extension during development #1035

Open lloydjatkinson opened 5 months ago

lloydjatkinson commented 5 months ago

Environment

Description

When I clone CodeMaid, build it, and then attempt to run/debug the extension in Visual Studio I get the following once I try interact with CodeMaid (eg. right clicking a colution or in the toolbar clicking Extensions > CodeMaid > Options)

  <entry>
    <record>2727</record>
    <time>2024/01/21 15:35:33.433</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>SetSite failed for package [CodeMaidPackage]Source: &apos;SteveCadwallader.CodeMaid&apos; Description: Method not found: &apos;Void EnvDTE._dispBuildEvents_OnBuildBeginEventHandler..ctor(System.Object, UIntPtr)&apos;.&#x000D;&#x000A;System.MissingMethodException: Method not found: &apos;Void EnvDTE._dispBuildEvents_OnBuildBeginEventHandler..ctor(System.Object, UIntPtr)&apos;.&#x000D;&#x000A;   at SteveCadwallader.CodeMaid.CodeMaidPackage.&lt;RegisterEventListenersAsync&gt;d__37.MoveNext()&#x000D;&#x000A;   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine&amp; stateMachine)&#x000D;&#x000A;   at SteveCadwallader.CodeMaid.CodeMaidPackage.RegisterEventListenersAsync()&#x000D;&#x000A;   at SteveCadwallader.CodeMaid.CodeMaidPackage.&lt;InitializeAsync&gt;d__33.MoveNext() in C:\Users\Lloyd\source\repos\codemaid\CodeMaidShared\CodeMaidPackage.cs:line 207&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;   at Microsoft.VisualStudio.Shell.AsyncPackage.&lt;&gt;c__DisplayClass21_0.&lt;&lt;Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize&gt;b__1&gt;d.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()&#x000D;&#x000A;   at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e)&#x000D;&#x000A;   at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck)</description>
    <guid>{4C82E17D-927E-42D2-8460-B473AC7DF316}</guid>
    <hr>0x80131513</hr>
    <errorinfo></errorinfo>
  </entry>

image

Steps to recreate

  1. Clone this repo
  2. Build it
  3. Run the extension

Current behavior

It does not allow me to debug and develop the extension

Expected behavior

I'm able to right click a solution, or navigate to Extensions > CodeMaid > Options without getting an error dialog.