How to access folder form a .tool application
You simply have to supply the full path to the DLL in the script.

When you run the script from Terminal.app, the PWD environment variable contains the path to the folder where you're currently placed. I.e. if you use cd to move to other folders, the PWD environment variable is automatically updated to match.

When you're using the GUI and double-clicking an icon, you're not really "in" a specific folder at the time. So the same concept of a PWD environment variable tracking your movements do not make sense.

Instead simply supply the full path in the script, such as:

dotnet ~/OUTPUT/Calculator.dll


Here ~ means that currently logged in user's home folder.