In light of the fact that C # is used a lot on which platforms, a piece of old code can be used on them anyway anyway, but if the program on the computer supports pieces of the WinForms project tightened in WPF, ASP swears at them.

Is there a mechanism to ignore this piece of code depending on the platform?

I hope the question is correctly set.

  • If you mean problems when connecting ready-made libraries or projects written for one platform to a project for another platform, then no, it will not work out, each platform has its own problems and dependencies that are not always compatible with each other. If I were you, I would allocate the necessary and platform-independent code into a separate library, and it would be connected to all other projects. If the other projects are legacy legacy, which is not planned to be maintained and developed, then simply cut out the necessary code from there. - rdorn 7:07 pm
  • Like, through the preprocessor, you can ignore parts of the code. At the very Microsoft it is in the source met. - iluxa1810 8:49 pm
  • @adrug yes, this thing interested me. I figured it out myself, but thanks anyway. I do not know how to use the site correctly, because I can put a plus sign for a suitable answer or something like that? - Sergey
  • @ Sergey, yes, but I think it would be better if you offer your own solution to your own problem as an answer! - adrug

1 answer 1

is decided. Everything was painfully simple and obvious. it was necessary to just take out a piece of platform-specific code to a separate place, that's all)

well, or use directives like #if