Open KerstinKeller opened 6 days ago
It also seems to be related to the pyproj Files themselves. Take the following:
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == 'RelWithDebInfo' ">
</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>ed257ab2-033d-3b6e-9c0e-9ee5d38d9d8c</ProjectGuid>
<ProjectHome>.</ProjectHome>
<StartupFile>D:/github/project/lang/python/samples/core/service/file.py</StartupFile>
<SearchPath>..\..\..\..\bin\RelWithDebInfo\python</SearchPath>
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<Name>py_minimal_service_client</Name>
<RootNamespace>py_minimal_service_client</RootNamespace>
<InterpreterId>MSBuild|debugging-env|$(MSBuildProjectFullPath)</InterpreterId>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'RelWithDebInfo' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<ItemGroup>
<Compile Include="D:/github/project/lang/python/samples/core/service/file.py" />
</ItemGroup>
<ItemGroup>
<Interpreter Include="C:/Users/xxx/AppData/Local/Programs/Python/Python312">
<Id>debugging-env</Id>
<Version>0.0</Version>
<Description>Debugging Environment (Python 3.12.0 )</Description>
<InterpreterPath>C:/Users/xxx/AppData/Local/Programs/Python/Python312/python.exe</InterpreterPath>
<WindowsInterpreterPath>C:/Users/xxx/AppData/Local/Programs/Python/Python312/python.exe</WindowsInterpreterPath>
<PathEnvironmentVariable>PYTHONPATH</PathEnvironmentVariable>
<Architecture>X64</Architecture>
</Interpreter>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
<!-- Uncomment the CoreCompile target to enable the Build command in
Visual Studio and specify your pre- and post-build commands in
the BeforeBuild and AfterBuild targets below. -->
<!--<Target Name="CoreCompile" />-->
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
</Project>
The files are generated like this, because I want to be able to debug the RelWithDebInfo
builds, for C++ extensions which are build with nanobind
.
Especially the first property group seems to cause problems sometimes, when I change
<Configuration Condition=" '$(Configuration)' == 'RelWithDebInfo' ">
to
<Configuration Condition=" '$(Configuration)' == 'Release' ">
there is a higher chance that I can actually use the debugger.
Describe the bug I get the below error message when loading a bigger solution file, that contains both C++ and Python projects. It's a CMake based project and all project files are generated from within CMake. When I closed the project the other night, everything was working ok
Expected behavior Opening VS without exception / error, being able to debug the Python project.
Additional context and screenshots
Error on Debug
Configuration information (If you are providing a diagnostics file (see below), skip this section) VS Version: Version 16.11.41 PTVS version: 16.11.21196.2 Python version: 3.12.0 Debugger Type (if applicable): [New debugger or legacy debugger?]
Diagnostics file I was not able to locate a diagnostics file in the Temp Directory
One last note: To me, there is no apparent reason as to when I am able to debug when launching a pyproj. Sometimes it works, sometimes it doesn't. Sometimes I need to restart Visual Studio. It would be very helpful if the the displayed dialog contained more information on why launching is not possible.