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

Need to support Publish in multi-TFM projects #175

Closed
eerhardt opened this issue Sep 26, 2016 · 8 comments
Closed

Need to support Publish in multi-TFM projects #175

eerhardt opened this issue Sep 26, 2016 · 8 comments

Comments

@eerhardt
Copy link
Member

See dotnet/cli#4237 (review)

We don't have "outer build" support for the "Publish" target. Thus, you can only publish single-TFM projects, or multi-TFM projects when you explicitly specify the single TFM.

When enabling this scenario, we need to think about how dotnet publish3 --output C:\temp works with multi-TFM projects. In the project.json based projects, the CLI raised an error if a user specified an output path, but didn't specify a framework. I'd like to see our tooling support only specifying an output path if the project only targets a single framework. It should only throw if there are multi-TFMs specified in the project and the user only specifies a --output path.

@nguerrera
Copy link
Contributor

Wouldn't it be useful to publish all to an output folder and then have sub-folders for each TFM? Can we make that the semantics of outer publish?

@eerhardt
Copy link
Member Author

eerhardt commented Sep 27, 2016

Wouldn't it be useful to publish all to an output folder and then have sub-folders for each TFM?

For a single TFM, that would irk me. "I told you to put my project in C:\temp, and you put it in C:\temp\netcoreapp1.0".

When a user doesn't specify an output folder, then yes we have sub-folders for each TFM. But if they explicitly passed in an output folder, we should put the end app in the folder they specified. Thus, why it is an error to only specify the output folder when you have multiple TFMs.

@nguerrera
Copy link
Contributor

Do you feel the same way about build output dir for single TFM?

@eerhardt
Copy link
Member Author

Yes, build and publish output should work the same. If I told you to put it in folder xyz , it should be in folder xyz.

@nguerrera
Copy link
Contributor

We probably need to take a step back and re-optimize for single TFM. If we were to allow/encourage <TargetFramework>xyzN.N</TargetFramework> over <TargetFrameworks>xyzN.N</TargetFrameworks> we could use that to have different behavior such as not bothering with sub-dirs. And publish for plural would create subdirs just like how build works. Right now, restore3 is broken without the plural and we always make the subdir for build, but we could change it (and I think we should).

cc @srivatsn

@eerhardt
Copy link
Member Author

There are two work items here:

  1. Give a nice error message when calling "publish" on a project that targets multiple TFMs saying that the user should specify the TFM. Add cross-targeting Publish target with nice error message. #247
  2. By default, our project templates should target the singular $(TargetFramework) property. This is currently blocked on getting a NuGet build with Restore to project with single TargetFramework must not condition props NuGet/Home#3588 fixed.

@srivatsn
Copy link
Contributor

Filed a separate issue for 2 above - #251

@eerhardt
Copy link
Member Author

Since #247 has been merged, I'm closing this issue.

I'm working on fixing #251 right now.

sbomer pushed a commit to sbomer/sdk that referenced this issue Sep 19, 2017
mmitche pushed a commit to mmitche/sdk that referenced this issue Jun 5, 2020
Adding IsInnerBuild check for CleanCopiedAssemblies
GangWang01 pushed a commit to GangWang01/sdk that referenced this issue Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants