Skip to content

Blazor template with individual auth breaks on windows (Data\app.db?) #60807

Open
@skyslide22

Description

@skyslide22

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

My Blazor project with individual auth using a local sqllite database breaks on windows, this is the command i used to create the project on macos:
dotnet new blazor --auth Individual -int WebAssembly

So this creates a app.db file in the Data folder in the Server project, and when running dotnet ef database update it actually creates a new file in the Server project with the name Data\app.db, also the appsettings.json have this backslash instead of a forward slash:

  "ConnectionStrings": {
    "DefaultConnection": "DataSource=Data\\app.db;Cache=Shared"
  },

The app runs fine on macos, but it fails to find the file on azure/windows, changing the backslash to a forward slash fixed the issue.
Also checking out to a project with this template on windows after cloning the repo fails in visual studio, fixed with slash change in appsettings.json and deleting the Data\app.db file (the backward slash is part of the file name, Data is not a folder in this case)

i have used dotnet 8 and 9, same behaviour

Image

Image

Expected Behavior

Project created with dotnet new blazor --auth Individual -int WebAssembly on macos to be working on windows as well

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

8 & 9

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-identityIncludes: Identity and providers

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions