-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Buildalyzer seems to be using C# 11 instead of 7.3 on some machines even for a .NET 4.8 project. #277
Comments
@jons-bakerhill, I'm trying to create the scenario, could you give me some information?
if you can publish the result of dotnet --info. |
Sorry for the delay, was off work for a bit there. I still need to nag a couple other people but I got the information you requested from one of our developers. Version 22H2 (OS Build 19045.4291) Runtime Environment: .NET workloads installed: Host: .NET SDKs installed: .NET runtimes installed: Other architectures found: Environment variables: global.json file: |
The output on my machine is the following:
Runtime Environment: .NET workloads installed: Host: .NET SDKs installed: .NET runtimes installed: Other architectures found: Environment variables: global.json file: Output from another one where it seems to be misbehaving .NET SDK: Runtime Environment: .NET workloads installed: Host: .NET SDKs installed: .NET runtimes installed: Other architectures found: Environment variables: global.json file: |
Thanks, I'll try to simulate |
@jons-bakerhill I'm creating the environment, are the projects loaded from various versions of dotnet including 4.8 or just 4.8? In the context of your last print. |
TargetFramework or TargetFrameworkVersion in the .csproj files is one of net48 v4.8 net6.0 net6.0 net8.0 netcoreapp2.1 or netstandard2.0 across our entire repository. The projects involved should all be either net48 or v4.8. There is a mix of old and new (SDK style) project files currently. |
I'm using Buildalyzer to get project for Rosyln analysis to use for code generation. On my machine things generate as expected but on some of our other developers machines Guid is being flag as "isReferenceType" which breaks the code generation. I've spent a decent bit of time digging and it appears that somehow on their machines the resulting compilation LanguageVersion is set to CSharp11 while on mine it is CSharp7_3. I suspect the handling of types (in particular nullable reference types) changed in Rosyln across those versions.
I found WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3)) but haven't figured out a straightforward (or working) way to set it in the code flow below.
The text was updated successfully, but these errors were encountered: