Debugging broken for x64 platform in 16.7.x-16.8.0 (The parameter is incorrect E_INVALIDARG)
See original GitHub issueI’m experiencing The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
pop-up messages when attempting to run or debug python scripts in Visual Studio 2019 16.7.x-16.8.0. This used to work fine in previous versions of VS2019. The problem seem to be related to the x64
vs. Any CPU
platform used to include the python project into the VS2019 solution.
Related issues: https://github.com/microsoft/PTVS/issues/6204 & https://github.com/microsoft/PTVS/issues/6278 (both are closed).
The exception occurs in the following scenarios:
- When opening the “Debug” and “Publish” configuration pages for the project.
- When attempting to run a script using “Start without Debugging” or “Start with Debugging”
Details:
[Window Title]
devenv.exe
[Main Instruction]
An unexpected error occurred
[Expanded Information]
Build: 16.8.20241.2
System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
at EnvDTE.ConfigurationManager.get_ActiveConfiguration()
at Microsoft.PythonTools.Project.PythonProjectNode.SetCurrentConfiguration()
at Microsoft.VisualStudioTools.Project.ProjectNode.GetMsBuildProperty(String propertyName, Boolean resetCache)
at Microsoft.VisualStudioTools.Project.ProjectNode.GetProjectProperty(String propertyName, Boolean resetCache)
at Microsoft.PythonTools.Project.CondaEnvCreateProjectInfoBar.<CheckAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PythonTools.Project.PythonProjectNode.<TriggerInfoBarsAsync>d__107.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PythonTools.Infrastructure.VSTaskExtensions.<HandleAllExceptions>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
Minimal project to reproduce: https://github.com/forderud/CMakePTVS
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Debugging with "Command Arguments" in Visual Studio ...
Trying to work with "Command Arguments" in Visual Studio. I broke it down to a simple little ConsoleApplication program in C. #include "pch.h" ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for the minimal project, I am now able to reproduce.
This issue shows up also as a “false error” during builds of solutions that contain a pyproj and applies to all VS 16.8.x versions, up to and including 16.8.4
Error: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
It would be really useful if it was fixed. Thank you