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

Target framework and language version mismatch #96

Open
YImhof opened this issue Jun 14, 2024 · 0 comments
Open

Target framework and language version mismatch #96

YImhof opened this issue Jun 14, 2024 · 0 comments

Comments

@YImhof
Copy link

YImhof commented Jun 14, 2024

H5 documentation says "H5 projects are based on .Net Standard 2.1".
And for that framework, as defined by MS, default language version is C# 8.0 (see Language versioning)

But for real, the H5 SDK enforces usage of .Net Standard 2.0, as any change of the targeted framework in the properties through VS IDE is immediately rolled-back. And even more, the SDK sticks to language version C# 7.2 (see comments in file Sdk.targets) instead of default C# 7.3, which is also the language version of .Net Framework 4. And adding a <LangVersion>7.3<LangVersion> tag in the project has no effect.

I am trying to migrate some projects, currently based on Bridge.Net, to H5. And that seems not so straightforward due to this language version mismatch. As a showstopper example I encountered, Bridge.Net allowed usage of the generic type constraint "Enum" which became available in C# 7.3. So, as H5 is a fork of Bridge.Net, are you sure that C# 7.3 is not the real language version?

At least, I think documentation should mention the real targeted framework and the non standard language version, as depending on the used language features, migration from Bridge.Net might be compromised.

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

1 participant