Skip to content

Documentation improvements #7

Description

@mardukbp

First of all thank you for writing this awesome tool!

I installed it using .NET 8. When I executed GeneratePythonNetStubs I got the error (abridged):

You must install or update .NET to run this application.

Framework: 'Microsoft.NETCore.App', version '6.0.0' (x64)
.NET location: E:\dotnet-sdk-8-x64

Which means that it requires the .NET 6 x64 Runtime. I downloaded it, unpacked it in Downloads and then set the environment variable DOTNET_ROOT to the .NET 6 runtime. GeneratePythonNetStubs then did its magic :)

In order to use the typings in VS Code with the Python extension I added the following to settings.json:

"python.autoComplete.extraPaths": [
    "typings"
]

I think it would be great to provide these two pieces of information in the README so that people can benefit the most from your efforts.

Activity

  1. mardukbp commented on Jul 16, 2024

    @mardukbp
    Author

    Another tip. In order to automatically generate the typings after publishing the .NET Project with dotnet publish -c Release I added the following to the projects' .csproj file:

    <PropertyGroup Condition="'$(Configuration)'=='Release'">
      <DebugSymbols>False</DebugSymbols>
      <DebugType>None</DebugType>
      <PublishDir>..\proj</PublishDir>
    </PropertyGroup>
    
    <Target Name="GenerateStubs" AfterTargets="Publish">
      <Exec Command="GeneratePythonNetStubs --dest-path=../../typings --target-dlls=../proj/CalcTest.dll"/>
    </Target>
  2. mardukbp commented on Jul 17, 2024

    @mardukbp
    Author

    I found a simpler way to execute it with .NET 8:

    GeneratePythonNetStubs --roll-forward LatestMajor --dest-path=../../typings --target-dlls=../proj/CalcTest.dll
  3. added a commit that references this issue on Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions