dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.67k stars 1.06k forks source link

dotnet8 <AnalysisLevel> linux #43538

Closed LudwigHoff closed 1 week ago

LudwigHoff commented 1 week ago

AnalysisLevel is fine on Mac and Windows, fails on Linux

I have tried multiple from: https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#analysislevel

To Reproduce

e.g.

    <PropertyGroup>
        <AnalysisLevel>latest</AnalysisLevel>
    </PropertyGroup>

Exceptions (if any)

/usr/share/dotnet/sdk/8.0.401/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.Analyzers.targets(44,5): error MSB4184: The expression "[System.Text.RegularExpressions.Regex]::Replace(latest-Default, latest-, '')" cannot be evaluated. Object reference not set to an instance of an object. [/tmp/.scratch/cdk/Entrypoint/Entrypoint.csproj]

Further technical details

Runtime Environment: OS Name: debian OS Version: 12 OS Platform: Linux RID: linux-x64 Base Path: /usr/share/dotnet/sdk/8.0.401/

.NET workloads installed: Configured to use loose manifests when installing new manifests. There are no installed workloads to display.

Host: Version: 8.0.8 Architecture: x64 Commit: 08338fcaa5

.NET SDKs installed: 6.0.425 [/usr/share/dotnet/sdk] 8.0.401 [/usr/share/dotnet/sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 6.0.33 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.33 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found: None

Environment variables: Not set

global.json file: /tmp/.scratch/global.json

Learn more: https://aka.ms/dotnet/info

Download .NET: https://aka.ms/dotnet/download


- The is running `dotnet build` so outside of an IDE

- I am using a solution level global.json thusly:

cat global.json { "sdk": { "version": "8.0.0", "rollForward": "latestFeature" } }

LudwigHoff commented 1 week ago

And what do you know, I can't now repo. Apologies.