There used to be a tool for that task in our Perl Dev Kit. As far as I know, no other products ever existed that do the job, and the Perl Dev Kit has been discontinued since 2016.
Technically, there is no way to compile Perl. Perl isn’t a compiled language. The Perl Dev Kit created a self-extracting virtual file system inside a file, and pretended that was compiling. To make a fake dll, it then wrapped that inside another layer acceptable to .NET 2. It couldn’t talk to .NET 4 at all.
The whole notion of fake binaries no longer fools Windows, and it’s exactly the same behavior as a category of malware, so Perl wrapping tools that pretend to be compilers can’t be depended on.
If you want something you can use with .NET, write the code in C# and compile it with Visual Studio.