question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Debugging broken for x64 platform in 16.7.x-16.8.0 (The parameter is incorrect E_INVALIDARG)

See original GitHub issue

I’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:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
huguesvcommented, Nov 17, 2020

Thanks for the minimal project, I am now able to reproduce.

0reactions
masariellocommented, Feb 15, 2021

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found