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

forceConsistentCasingInFileNames TypeScrypt equivalent for dotnet #11456

Open
webartoli opened this issue Feb 17, 2025 · 2 comments
Open

forceConsistentCasingInFileNames TypeScrypt equivalent for dotnet #11456

webartoli opened this issue Feb 17, 2025 · 2 comments
Labels
Area-NetSDK BuildCheck Suggestion Suggestion for a built in MSBuild analyzer. Label should be applied together with 'Area: BuildCheck' untriaged

Comments

@webartoli
Copy link

Is your feature request related to a problem? Please describe.

Dotnet core is a cross-platform language, and increasingly we have teams with different operating systems.

On windows the filesystem is not case sensitive while on *nix it is, and this for dotnet build is a problem.

If on the filesystem for example we have the project Foo.Bar.Lib/Foo.Bar.Lib.csproj by another project as follows.

 <ItemGroup>
    <ProjectReference Includes="FOO.BAR.Lib/Foo.Bar.Lib.csproj" />
    <!--                        ^^^^^^^ wrong casing           -->
  </ItemGroup>

This on windows compiles while on Linux it does not.

Describe the solution you'd like

An option like forceConsistentCasingInFileNames in TypeScript would be useful.

Additional context

In my case many developers are on windows, the CI has windows agents, and running the developers' local environment has docker components.

Result: local build and ci build succeeds while there are build errors by launching docker build.

@marcpopMSFT
Copy link
Member

buildcheck request I believe.

@marcpopMSFT marcpopMSFT added the BuildCheck Suggestion Suggestion for a built in MSBuild analyzer. Label should be applied together with 'Area: BuildCheck' label Feb 18, 2025
@webartoli
Copy link
Author

I've done several tests with this repo:

src
` Foo.Bar.Lib/
  ` Foo.Bar.Lib.csproj
    Class.cs
` Foo.Bar.Console/
  ` Foo.Bar.Console.csproj
    Class.cs

Where Foo.Bar.Console.csproj file contains a reference with a different casing for the lib path:

 <ItemGroup>
    <ProjectReference Includes="FOO.BAR.Lib/Foo.Bar.Lib.csproj" />
    <!--                        ^^^^^^^ differs for casing     -->
  </ItemGroup>

Here below the results:

Dotnet SDK OS File System Result
8.0 LTS Windows 11 24H2 NTFS (Case insensitive) ✅ Build Success
8.0 LTS macOS Sequoia APFS (Case insensitive) ✅ Build Success
8.0 LTS Microsoft Hosted AzureDevOps Agent Ubuntu 20.04 ext4 (Case sensitive) ✅ Build Success
8.0 LTS Official mcr.microsoft.com/dotnet/sdk:8.0 docker image ext4 + overlay (Case sensitive) 🟥 Build Failed

I would expect a consistent result that was either in both cases red or in both cases green. But not different outputs on such similar architectures.

But if different behavior are expected for different os I think it is critical to include a flag/settings that can check for this issue regardless of the OS under which it is run.

Particularly in this scenario the CI marks as build succeeded but a local docker build fails and this is a serious issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NetSDK BuildCheck Suggestion Suggestion for a built in MSBuild analyzer. Label should be applied together with 'Area: BuildCheck' untriaged
Projects
None yet
Development

No branches or pull requests

3 participants