AddAnyFile
AddAnyFile copied to clipboard
Fails in VS2022 Preview 4.0
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
- In solution explorer
- Right click for context menu
- 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: 'AddAnyFile' Description: Could not load file or assembly 'EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly 'EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
 at MadsKristensen.AddAnyFile.AddAnyFilePackage.<InitializeAsync>d__4.MoveNext()
 at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
 at MadsKristensen.AddAnyFile.AddAnyFilePackage.InitializeAsync(CancellationToken cancellationToken, IProgress`1 progress)
 at Microsoft.VisualStudio.Shell.AsyncPackage.<>c__DisplayClass20_0.<<Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Microsoft.VisualStudio.Threading.JoinableTask.<JoinAsync>d__76.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e)
 at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
</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>
Duplicate of #87
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