Skip to content
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 publish multiple -r options #6490

Open
AndriySvyryd opened this issue Jun 21, 2016 · 13 comments
Open

dotnet publish multiple -r options #6490

AndriySvyryd opened this issue Jun 21, 2016 · 13 comments
Assignees
Labels
Area-NetSDK cli-ux Issues and PRs that deal with the UX of the CLI (exit codes, log output, verbs/options, and so on) enhancement PublishVsBuild
Milestone

Comments

@AndriySvyryd
Copy link
Member

Steps to reproduce

Run dotnet publish -r win7-x86 -r win7-x64

Expected behavior

Publish to run for each of the specified RIDs

Actual behavior

dotnet : Unexpected value 'win7-x64' for option 'runtime'

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview2-003118)

Product Information:
 Version:            1.0.0-preview2-003118
 Commit SHA-1 hash:  7ada53d523

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.10586
 OS Platform: Windows
 RID:         win10-x64
@blackdwarf
Copy link

@AndriySvyryd can you share your project.json? I assume you have the runtimes node in it?

@AndriySvyryd
Copy link
Member Author

AndriySvyryd commented Jun 22, 2016

Sure

{
  "version": "1.0.0-*",
  "buildOptions": {
    "emitEntryPoint": true
  },

  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.0"
    }
  },

  "frameworks": {
    "netcoreapp1.0": {}
  },

  "runtimes": {
    "win7-x86": {},
    "win7-x64": {}
  }
}

@blackdwarf
Copy link

@AndriySvyryd thanks, that looks good. What about if you run them one after another, that is, if you run them with one -r per invocation? Does it all work then?

@AndriySvyryd
Copy link
Member Author

@blackdwarf Yes, it works fine one-by-one

@TheRealPiotrP
Copy link
Contributor

@blackdwarf I'm going to put this in the backlog or the moment. multi-rid behaviors don't exist in the product to date. If we decide to pursue that, we'll need to take a wholesale look across the verbs.

@VAllens
Copy link

VAllens commented Sep 25, 2017

Now, is this enhancement available?
I strongly advise we to implement this feature, thank you !!! :)

@dasMulli
Copy link
Contributor

dasMulli commented Sep 25, 2017

as temporary solution, I've created custom targets that allow doing this in one invocation: https://gist.github.com/dasMulli/b14026437468ce4b56ef93e010f24a36 (drop the file in your project / solution directory or add the contents to the project).

Can be used by calling dotnet msbuild /m /t:PublishAll /p:Configuration=Release

@VAllens
Copy link

VAllens commented Sep 26, 2017

@dasMulli
Oh !!! It‘s works, thank you. :)
I saw your post on stackoverflow before.
I implemented the publish using the bash script.
Publish.sh

@kuskmen
Copy link

kuskmen commented Nov 16, 2017

Do we have any progress in this? It seems a bit cumbersome to publish each time for different RID?

Thanks,
YV

@livarcocc
Copy link
Contributor

No progress and it is currently in our backlog, which means we will not get to it by our next release. Please try @dasMulli 's workaround.

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
@msftgits msftgits added this to the Backlog milestone Jan 31, 2020
@Webreaper
Copy link

Bit sad that 3 years later this still isn't something that can be done easily from the command-line....

@mot256
Copy link

mot256 commented Mar 6, 2023

Well... add another 3 years...

@rubo
Copy link

rubo commented Mar 24, 2023

What a pity. I'd like to have the possibility to build for multiple platforms at once. For now, running with a single -r one by one results in dotnet restore and dotnet build for each platform. Would be way better to have this process optimized somehow. Even when I call dotnet restore and then dotnet publish --no-restore -r <rid> it ends with an error.

@baronfel baronfel added Area-NetSDK untriaged Request triage from a team member and removed untriaged Request triage from a team member labels Mar 24, 2023
@baronfel baronfel self-assigned this Aug 4, 2024
@baronfel baronfel added PublishVsBuild cli-ux Issues and PRs that deal with the UX of the CLI (exit codes, log output, verbs/options, and so on) labels Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NetSDK cli-ux Issues and PRs that deal with the UX of the CLI (exit codes, log output, verbs/options, and so on) enhancement PublishVsBuild
Projects
None yet
Development

No branches or pull requests