xsharp.eu • Welche Version von Visual Studio ist für 2.18 zu empfehlen
Page 1 of 2

Welche Version von Visual Studio ist für 2.18 zu empfehlen

Posted: Mon Nov 06, 2023 8:38 am
by comitas2
Hallo,
welche Version von Visual Studio ist für die gerade veröffentlichte 2.18 Public zu empfehlen?
Die Help-FAQ sagt dazu: "At this moment X# supports the Visual Studio versions 2015, 2017, 2019 and 2019 Preview.".
Dieser Eintrag stammt allerdings vom 26 September 2019. Ist das denn auch noch so?
Gruß Jörg

Re: Welche Version von Visual Studio ist für 2.18 zu empfehlen

Posted: Mon Nov 06, 2023 8:44 am
by wriedmann
Hallo Jörg,
prinzipiell kannst Du davon ausgehen, dass X# immer die aktuellste freigegebene Version von VS und die Vorversion unterstützt.
2015 und 2017 laufen meines Wissens nach nicht mehr. 2019 und 2022 sind unterstützt.
Wolfgang

Re: Welche Version von Visual Studio ist für 2.18 zu empfehlen

Posted: Mon Nov 06, 2023 8:49 am
by robert
Hallo Jörg,
Thanks for reminding me to update the FAQ.
I would recommend VS 2022.

Robert

Re: Welche Version von Visual Studio ist für 2.18 zu empfehlen

Posted: Mon Nov 06, 2023 8:51 am
by comitas2
Hallo Wolfgang, hallo Robert
vielen Dank für die Info.
Gruß Jörg

Re: Welche Version von Visual Studio ist für 2.18 zu empfehlen

Posted: Tue Nov 07, 2023 6:19 am
by HansjoergP
Bei der Version von Visual Studio hängt es davon ab, ob man auf 32bit ist und Winforms benötigt. In VS2022 funktionieren bestimmte Kombinationen mit Winforms und 32bit nicht (designer). Dies ist ein Problem von der Umstellung von VS2022 auf 64bit und eine Teilweise Lösung wird von Microsoft für die nächste Version versprochen
Hansjörg

Re: Welche Version von Visual Studio ist für 2.18 zu empfehlen

Posted: Tue Nov 07, 2023 7:07 am
by robert
Hansjoerg,
The problem with the WinForms Designer and X# only exists if you choose the external winforms designer.
The internal Winforms designer in VS2022 works just like in VS2019.

Background:
VS itself uses the .Net Framework and in the Winforms designer it really "runs" the code from the controls.
To design for .Net 5/6/7/8 and to create the controls for these versions of .Net the designer needs to run in that version of .Net.
For that reason, the designer has to be a separate process.
The old designer was language agnostic (we are creating an object model description of the form and feed that to the designer).
Unfortunately, Microsoft has created a new (external) designer and has chosen to only support C# and VB in this designer.



Robert

Re: Welche Version von Visual Studio ist für 2.18 zu empfehlen

Posted: Tue Nov 07, 2023 9:38 am
by ic2
robert wrote: Tue Nov 07, 2023 7:07 am To design for .Net 5/6/7/8 and to create the controls for these versions of .Net the designer needs to run in that version of .Net.
For that reason, the designer has to be a separate process.
Interesting.

Doesn't that make using VS2022 + Winforms + .Net 5/6/7/8 basically impossible (for any language)? Suppose you want to support .Net 7 because client A uses it and you are using .Net 8. Then you first have to install the older version .Net 7 to design a screen for that client? Then once again for client B with .Net6. And the form you designed for client B doesn't run in the system of client A and not in your own system when you go back to .Net 8. Etc.

Unless I misunderstand something.

Also does this mean:

1 When using VS2019 this problem doesn't exist?
2 When using .Net Framework this problem doesn't exist, also not in .Net 5/6/7/8?

Dick

Re: Welche Version von Visual Studio ist für 2.18 zu empfehlen

Posted: Tue Nov 07, 2023 9:57 am
by robert
Dick,
You did not completely get it.
- Yes, if you want to develop for .Net 7 you need to install .Net 7. That makes sense, I think.
- Forms will run in an earlier version, unless you use features that did not exist in that version. The new editor is needed to allow you to use new features. Also, if you have a 3rd party control for .Net 5/6/7/8 and do not have a version of that control for .Net Framework, then you also need the external editor.
- No, VS2019 cannot develop for .Net 5/6/7/8
- Yes, If you develop for .Net framework with VS2019 and earlier, there is no issue.
- And if you develop for .Net Framework in VS2022 and use the internal windows forms editor, then there is also no problem.

Btw the option for the external editor is available from the "Preview Features" menu option:
form.png
form.png (2.88 KiB) Viewed 2172 times
Robert

Re: Welche Version von Visual Studio ist für 2.18 zu empfehlen

Posted: Tue Nov 07, 2023 11:25 am
by VR
I remember an issue, that I created some time ago regarding the Winforms Designer in VS 2022 and 32Bit component libraries...

https://github.com/X-Sharp/XSharpPublic/issues/959

So the combination of VS2022 (which is 64bit) + Winforms Designer + Components imported from a 32Bit assembly doesn't work. In that case, the easiest solution is to continue with VS2019 (which is 32bit)

Volkmar

Re: Welche Version von Visual Studio ist für 2.18 zu empfehlen

Posted: Tue Nov 07, 2023 5:21 pm
by ic2
Thanks Robert, Volkmar for the replies, it is very enlightening. Still one thing seems contradictory:

Robert:And if you develop for .Net Framework in VS2022 and use the internal windows forms editor, then there is also no problem.
Volkmar:So the combination of VS2022 (which is 64bit) + Winforms Designer + Components imported from a 32Bit assembly doesn't work.

I am still trying to establish if it makes sense to use VS2022 (eventually).

For me, the only advantage would be that MS wrote in an issue I posted that VS wouldn't start on the 3rd monitor (which happens frequently although I hardly use that monitor and never close VS there) - they wrote that they solved it for VS2022 only (what likely means that it isn't solved there either). And, I understand now, if I would like to try something in .Net 5/6/7/8 I would need it too.

Dick