-
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
There doesn't seem to be a way to execute tasks or targets for 'dotnet run' #18436
Labels
Milestone
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. |
61 tasks
marcpopMSFT
added
Area-CLI
Area-NetSDK
and removed
needs team triage
Requires a full team discussion
labels
Aug 4, 2021
This is a reasonable request but deferring to investigations around multi-project startup. @KathleenDollard |
rolfbjarne
added a commit
to rolfbjarne/xamarin-macios
that referenced
this issue
Aug 17, 2021
…'dotnet run'. .NET doesn't support executing other targets/tasks when doing "dotnet run". However, we need to (like we do for our current "Run" target), so implement a rather simplistic/hacky workaround by making "dotnet run" just do "dotnet build /t:Run". It doesn't support everything that "dotnet run" does (for instance it doesn't support the /no-build flag), but it should work for most use cases. Ref: dotnet/sdk#18436
rolfbjarne
added a commit
to xamarin/xamarin-macios
that referenced
this issue
Aug 17, 2021
…'dotnet run'. (#12458) .NET doesn't support executing other targets/tasks when doing "dotnet run". However, we need to (like we do for our current "Run" target), so implement a rather simplistic/hacky workaround by making "dotnet run" just do "dotnet build /t:Run". It doesn't support everything that "dotnet run" does (for instance it doesn't support the /no-build flag), but it should work for most use cases. Ref: dotnet/sdk#18436
Any updates on this? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
For mobile platforms (iOS, tvOS), we need to execute tasks to figure out a few things before we can run an app.
So we implemented a target to run before the
Run
target:https:/xamarin/xamarin-macios/blob/6ce5f80cb7ef96000652fdd534c9176b793402e9/dotnet/targets/Xamarin.Shared.Sdk.targets#L859
This works fine for
dotnet build -t:Run
, but it doesn't not work fordotnet run
, because from what I can seedotnet run
will pick out theRunCommand
andRunArguments
properties once the project has been evaluated:sdk/src/Cli/dotnet/commands/dotnet-run/RunCommand.cs
Lines 236 to 263 in a30e465
instead of executing the
Run
target, which means that theRunCommand
andRunArguments
properties aren't set, because we set them inside a target:https:/xamarin/xamarin-macios/blob/6ce5f80cb7ef96000652fdd534c9176b793402e9/dotnet/targets/Xamarin.Shared.Sdk.targets#L846-L849
The end result is that with an iOS app executing
dotnet run
just doesn't work:sudo dotnet workload install microsoft-ios-sdk-full
The text was updated successfully, but these errors were encountered: