Runtime DLL for PythonNet in C# assembly targetting .NET 9.0 not copied

Will Pittenger 306 Reputation points
2025-03-12T09:07:29.63+00:00

I have a project intended to test how to call yt-dlp's source from within a PowerShell Cmdlet. So I created https://github.com/WillPittenger/YtDlpTest so I could see what the methods output. But PythonNET's DLL, python.runtime.dll, isn't being copied. I have it installed as a Nuget dependency. So I thought it would copy the DLL during the build. It isn't.

I saw links on Google that suggested something about setting "Copy Local" to true, but I can't figure out what those pages are talking about. They seem to be at least 10 years old in general so I think they reference the old build system. Some pages talk about replacing packages.config with <PackageReference/>, but I started out with <PackageReference/> entries.

I'm a little lost as to what's going on. I thought Nuget dependencies get copied automatically. I thought maybe the DLL in question was in my python37 folder, but I don't see it there.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
42,609 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.