Open Closed

Incompatibility Issue with 204 Responses when Using app.UseAbpStudioLink() in ASP.NET Core Applications with Event Streaming #8264


User avatar
0
PasionaDev created
  • Template: app
  • Created ABP Studio Version: 0.8.2
  • Tiered: No
  • UI Framework: angular
  • Theme: basic
  • Theme Style: system
  • Database Provider: ef
  • Database Management System: sqlserver
  • Separate Tenant Schema: No
  • Mobile Framework: none
  • Progressive Web App: No
  • Public Website: No
  • Optional Modules:
    • GDPR
    • FileManagement
    • TextTemplateManagement
    • LanguageManagement
    • AuditLogging
    • OpenIddictAdmin

Integrating app.UseAbpStudioLink() in the HostModule of an ASP.NET Core application causes a conflict with HTTP response handling. Specifically, when making requests that require event streaming (such as text/event-stream), the application throws an exception related to the 204 status code. This prevents the endpoint from sending data in the response body when Transfer-Encoding is set.

Environment:

Framework: ASP.NET Core Middleware: UseAbpStudioLink in ABP Server: Kestrel/IIS Project Configuration: Uses event streaming (text/event-stream) to send real-time data to clients. Steps to Reproduce:

  • Create an application with ABP using ABP Studio.
  • Configure an endpoint to send data with text/event-stream.
  • Make a GET request to the configured endpoint for event streaming. Expected Behavior: The application should send real-time data via event streaming, keeping the connection open and allowing the continuous transmission of data without issues.

Current Behavior: The application throws the following exception when attempting to send data through the response stream: System.InvalidOperationException: Setting the header Transfer-Encoding is not allowed on responses with status code 204.

Additionally, warnings are generated indicating that the Transfer-Encoding header is not allowed with the 204 status code. Removing app.UseAbpStudioLink() from the HostModule resolves the issue, and the endpoint can send data without interruption.


1 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    could you share some error logs and screenshots? thanks.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on June 13, 2025, 11:37