Linux .NET 6 exe seeks DLL in current dir instead of its own

Viewed 30

I just upgraded a .NET Core application from .NET 5 to 6. I used to start this application via a symbolic link in my home directory.

However, after updating the link to the newly-created .NET 6 version of my program, I get this:

$ ln -S ProgramName /home/UserName/Dev/ProgramName/bin/Debug/net6.0/ProgramName
$ ./ProgramName myargs
The application to execute does not exist: '/home/UserName/ProgramName.dll'.

Why is it looking for its namesake DLL in the current directory now?

I didn't have this behavior in the .NET 5 version, this seems like a big regression. How can I fix or work around this problem?

1 Answers

Turns out the correct link command was:

ln -s /home/UserName/Dev/ProgramName/bin/Debug/net6.0/ProgramName ProgramName

(confusion resulting from the order being swapped relative to Windows's symbolic link command line)

Related