Skip to content

HTTP 400 for negotiate call in Blazor Web App (InteractiveServerSideRendering(prerendering:false) #64713

@philippdolder

Description

@philippdolder

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Using the Blazor Web App template I changed two things:

  • disable prerendering
  • configure app to run from subfolder subfolder

I'm running it on the dev machine -> Environment is Development

After these changes the call to http://localhost:5187/subfolder/_blazor/negotiate?negotiateVersion=1 returns a HTTP 400 with the message A valid antiforgery token was not provided with the request. Add an antiforgery token, or disable antiforgery validation for this endpoint. and the screen remains blank.

Expected Behavior

work as normal but serving from configured subfolder

Steps To Reproduce

Minimal repro based on empty template. Steps as individual commits can be found in the github repo https://github.com/philippdolder/negotiate-400

It's based on dotnet new blazor -o Ui --interactivity Server --empty --all-interactive --use-program-main

Exceptions (if any)

No response

.NET Version

10.0.100

Anything else?

output of dotnet --info

.NET SDK:
Version: 10.0.100
Commit: b0f34d51fc
Workload version: 10.0.100-manifests.4c0ca8ba
MSBuild version: 18.0.2+b0f34d51f

Runtime Environment:
OS Name: Windows
OS Version: 10.0.26200
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.100\

.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.

Host:
Version: 10.0.0
Architecture: x64
Commit: b0f34d51fc

.NET SDKs installed:
8.0.319 [C:\Program Files\dotnet\sdk]
8.0.416 [C:\Program Files\dotnet\sdk]
9.0.308 [C:\Program Files\dotnet\sdk]
10.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
DOTNET_CLI_TELEMETRY_OPTOUT [1]
DOTNET_WATCH_RESTART_ON_RUDE_EDIT [1]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions