I fixed this issue by deleting the .vs folder and relaunching Visual Studio
Unable to Open Python Files in VisualStudio 2022
An error occurred in 'Miscellaneous Files' while attempting to open 'statisfinapp.py'
System.Runtime.InteropServices.COMException (0x80041FEB): Exception from HRESULT: 0x80041FEB
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Microsoft.VisualStudio.PlatformUI.Packages.ShellService.EditorFactories.EditorFactory.<CreateEditorInstanceAsync>d__43.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.Platform.WindowManagement.WindowFrame.<>c__DisplayClass84_0.<<CreateEditorInstanceAsync>g__CreateEditorInstanceAsync|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.Platform.WindowManagement.WindowFrame.<CreateEditorInstanceAsync>d__84.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.Platform.WindowManagement.WindowFrame.<LoadDocumentFrameInternalAsync>d__83.MoveNext()
I have tried:
Uninstalling and reinstalling Visual Studio
Repairing Visual Studio with installer
Trying the Beta version
I still cannot open any Python files within Visual Studio 2022
Versions: 17.9.6
Beta version: 17.10.0