-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'dotnet run -- args' requires 'args' to exist #18437
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
What is the name of the application that is built? |
HelloMacCatalyst This is the source code: https:/dotnet/maui-samples/tree/main/HelloMacCatalyst
Yes. Note that we set although I don't see how that would make the actual user arguments verified as valid paths (which they obviously don't have to be) |
I'm looking into this issue. So far, I've confirmed that this does not repro with a simple console app so this appears to be something specific to the maui sample app
Source:
|
@rolfbjarne I've reproed and investigated more and I believe that this is a result of setting the RunCommand and RunArguments in the file you linked. I've experimented with the simple console app I used above by adding:
I'm not sure exactly how the RunCommand and RunArguments properties are supposed to interact with command line arguments to the run command, but maybe @rainersigwald can comment. |
sdk/src/Cli/dotnet/commands/dotnet-run/RunCommand.cs Lines 238 to 250 in a30e465
|
I'm pretty sure the error is coming from macOS's ❯ open a b c
The files /Users/raines/temp/a, /Users/raines/temp/b, and /Users/raines/temp/c do not exist. |
🤦 Sorry I didn't figure this out myself. |
When we're using 'open' to launch apps, we need to use '--args ...' to pass any additional argument to the app, because otherwise 'open' will try to open those arguments as if they were files: ``` $ open "/Applications/Sublime Text.app" helloworld The file /Users/rolf/test/helloworld does not exist. ``` (and doesn't launch Sublime Text). while this works: ``` $ open "/Applications/Sublime Text.app" --args helloworld ``` in that it opens Sublime Text. It's also possible to not append any other arguments, so this: ``` $ open "/Applications/Sublime Text.app" --args ``` while it looks weird, it works just fine. Ref: dotnet/sdk#18437
…12019) When we're using 'open' to launch apps, we need to use '--args ...' to pass any additional argument to the app, because otherwise 'open' will try to open those arguments as if they were files: ``` $ open "/Applications/Sublime Text.app" helloworld The file /Users/rolf/test/helloworld does not exist. ``` (and doesn't launch Sublime Text). while this works: ``` $ open "/Applications/Sublime Text.app" --args helloworld ``` in that it opens Sublime Text. It's also possible to not append any other arguments, so this: ``` $ open "/Applications/Sublime Text.app" --args ``` while it looks weird, it works just fine. Ref: dotnet/sdk#18437
Description
Repro:
sudo dotnet workload install microsoft-maccatalyst-sdk-full
$ cd HelloMacCatalyst $ dotnet build $ dotnet run --no-build -- helloworld The file /Users/rolf/work/net6-mobile-samples/HelloMacCatalyst/helloworld does not exist.
Note that the error does not come from the Mac Catalyst test app, which is never executed. In fact you can delete everything, and try again without building, and you get the same error (now it'll also complain that the Mac Catalyst app doesn't exist, which makes sense):
The text was updated successfully, but these errors were encountered: