Skip to content

[Preview 8] static assets not found when launchSettings.json is missing #13190

@akorchev

Description

@akorchev

If you believe you have an issue that affects the security of the platform please do NOT create an issue and instead email your issue details to secure@microsoft.com. Your report may be eligible for our bug bounty but ONLY if it is reported through email.

Describe the bug

If the Properties/launchSettings.json file is missing static assets from Razor class libraries no longer seem to work. They all lead to HTTP 404 status.

To Reproduce

Steps to reproduce the behavior:

  1. Create a blazorserver application using Preview 8: dotnet new blazorserver
  2. Install a third party library that has static assets e.g. Blazored.Toast: dotnet add package Blazored.Toast
  3. Include its CSS file by adding this line to _Host.cshtml: <link href="_content/Blazored.Toast/blazored-toast.css" rel="stylesheet" />
  4. Run the application dotnet run and open the asset by loading https://localhost:5001/_content/Blazored.Toast/blazored-toast.css. You should see the file content.

image

  1. Stop the application and delete the launchSettings.json file from the Properties directory rm -rf Properties/launchSettings.json
  2. Run the application dotnet run and open the asset by loading https://localhost:5001/_content/Blazored.Toast/blazored-toast.css. It is no longer found.

image

Expected behavior

The assets should work with or without launchSettings.json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions