AddAnyFile icon indicating copy to clipboard operation
AddAnyFile copied to clipboard

Fails in VS2022 Preview 4.0

Open richardcox13 opened this issue 4 years ago • 2 comments

Installed product versions

  • Visual Studio: 2022 Enterprise 17.0.0. Preview 4
  • This extension: 3.5.159

Description

Trying to add empty file via solution explorer context menu, get popup saying:


Microsoft Visual Studio

The 'AddAnyFilePackage' package did not load correctly.

The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file 'C:\Users\richard\AppData\Roaming\Microsoft\VisualStudio\17.0_45d059e1\ActivityLog.xml'.

Steps to recreate

  1. In solution explorer
  2. Right click for context menu
  3. Add | New Empty File

Current behavior

Get error shown above

Expected behavior

Prompt for file name.

NB. ActivityLog.xml contains

  <entry>
    <record>1035</record>
    <time>2021/09/17 18:07:31.499</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Begin package load [AddAnyFilePackage]</description>
    <guid>{27DD9DEA-6DD2-403E-929D-3FF20D896C5E}</guid>
  </entry>
  <entry>
    <record>1036</record>
    <time>2021/09/17 18:07:31.566</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>SetSite failed for package [AddAnyFilePackage]Source: &apos;AddAnyFile&apos; Description: Could not load file or assembly &apos;EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos; or one of its dependencies. The system cannot find the file specified.&#x000D;&#x000A;System.IO.FileNotFoundException: Could not load file or assembly &apos;EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos; or one of its dependencies. The system cannot find the file specified.&#x000D;&#x000A;File name: &apos;EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos;&#x000D;&#x000A;   at MadsKristensen.AddAnyFile.AddAnyFilePackage.&lt;InitializeAsync&gt;d__4.MoveNext()&#x000D;&#x000A;   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine&amp; stateMachine)&#x000D;&#x000A;   at MadsKristensen.AddAnyFile.AddAnyFilePackage.InitializeAsync(CancellationToken cancellationToken, IProgress`1 progress)&#x000D;&#x000A;   at Microsoft.VisualStudio.Shell.AsyncPackage.&lt;&gt;c__DisplayClass20_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 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;   at Microsoft.VisualStudio.Threading.JoinableTask.&lt;JoinAsync&gt;d__76.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)&#x000D;&#x000A;&#x000D;&#x000A;WRN: Assembly binding logging is turned OFF.&#x000D;&#x000A;To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.&#x000D;&#x000A;Note: There is some performance penalty associated with assembly bind failure logging.&#x000D;&#x000A;To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].&#x000D;&#x000A;</description>
    <guid>{27DD9DEA-6DD2-403E-929D-3FF20D896C5E}</guid>
    <hr>80070002</hr>
    <errorinfo></errorinfo>
  </entry>
  <entry>
    <record>1037</record>
    <time>2021/09/17 18:07:31.575</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>End package load [AddAnyFilePackage]</description>
    <guid>{27DD9DEA-6DD2-403E-929D-3FF20D896C5E}</guid>
    <hr>80070002</hr>
    <errorinfo></errorinfo>
  </entry>

richardcox13 avatar Sep 17 '21 18:09 richardcox13

Duplicate of #87

louwill avatar Sep 21 '21 17:09 louwill

This should now be fixed - if you try the new x64 version it should work on VS2022: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.AddNewFile64

conficient avatar Oct 24 '21 09:10 conficient