Unable to Open Python Files in VisualStudio 2022

shawnxhe 0 Reputation points
2024-05-10T22:35:02.15+00:00

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

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,696 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. shawnxhe 0 Reputation points
    2024-05-10T22:50:51.04+00:00

    I fixed this issue by deleting the .vs folder and relaunching Visual Studio

    0 comments No comments