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

Deutschsprachiges X#-Forum – German language forum

Moderator: wriedmann

comitas2
Posts: 48
Joined: Thu Jul 18, 2019 9:13 am
Location: Germany

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

Post 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
User avatar
wriedmann
Posts: 3784
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

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

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
robert
Posts: 4567
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

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

Post by robert »

Hallo Jörg,
Thanks for reminding me to update the FAQ.
I would recommend VS 2022.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
comitas2
Posts: 48
Joined: Thu Jul 18, 2019 9:13 am
Location: Germany

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

Post by comitas2 »

Hallo Wolfgang, hallo Robert
vielen Dank für die Info.
Gruß Jörg
HansjoergP
Posts: 142
Joined: Mon Jul 25, 2016 3:58 pm
Location: Italy

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

Post 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
User avatar
robert
Posts: 4567
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

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

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
ic2
Posts: 1865
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

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

Post 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
User avatar
robert
Posts: 4567
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

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

Post 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 2391 times
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
VR
Posts: 103
Joined: Sun Aug 23, 2020 3:07 pm
Location: Italy

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

Post 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
ic2
Posts: 1865
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

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

Post 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
Post Reply