Skip to content

Conditional Code in Base Project #16249

Answered by maxkatz6
robloo asked this question in Q&A
Jul 7, 2024 · 2 comments · 6 replies
Discussion options

You must be logged in to vote

Generally, different solutions are:

  1. Use APIs that compatible with shared target (not possible in your case).
  2. Use "interface in shared project + implementation in the platform project" approach. Verbose, but always works.
  3. Make shared project multitarget. It doesn't have to be a single "net8.0" project. You can multitarget it, add one or more platforms - i.e. shared project can target "net8.0;net8.0-windows", where "windows" one is only used for MyProject.UI.Windows, while keeping shared for the rest.
  4. Similar to #3, but introduce a new platform specific yet shared project with multitargetting. Something what I would prefer, keeping UI in the single-target shared project, while still having…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
5 replies
@maxkatz6
Comment options

@robloo
Comment options

@robloo
Comment options

@robloo
Comment options

@maxkatz6
Comment options

Answer selected by robloo
Comment options

You must be logged in to vote
1 reply
@robloo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants