dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.21k stars 9.95k forks source link

[dotnet-sdk-8.0.100-rc.1.23415.7] Fail to load local css,js with Cofoundry template. #50141

Closed Junjun-zhao closed 11 months ago

Junjun-zhao commented 1 year ago

Is there an existing issue for this?

Describe the bug

We are testing a web application created with Cofoundry .Net Core CMS framework, when we run on .net8(8.0.100-rc.1.23415.7) runtime, we noticed local css files does not load, so page doesn't show properly.

Application Name: Cofoundry,Cofoundry.Samples.SPASite OS: Windows 10 21H2 CPU: X64 .NET Build Number: dotnet-sdk-8.0.100-rc.1.23415.7 App & Source Location Checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1871585 App github link: https://github.com/cofoundry-cms/cofoundry https://github.com/cofoundry-cms/Cofoundry.Samples.SPASite

Verify Scenarios: 1). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.100-rc.1.23415.7: Fail 2). Windows 10 21H2 AMD64 + dotnet-sdk-6.0.413-win-x64: Pass 3). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.100-rc.1.23412.1: Pass

Expected Behavior

Shows setup page

Steps To Reproduce

Minimal Repro steps (Demo attached): WebApplication1.zip

ref: Installing | Cofoundry Docs

1) Create ASP.NET Core Web App project(.net6) 2) Install this nuget package : Cofoundry.Web.Admin --version 0.11.4 3) Add this code to program.cs to configure Cofoundry

         var builder = WebApplication.CreateBuilder(args);
            builder.Services
                .AddControllersWithViews()
                .AddCofoundry(builder.Configuration);
            var app = builder.Build();
            app.UseHttpsRedirection();
            app.UseCofoundry();
            app.Run();

4) Add Db Connection to appsettings.json, MyCofoundrySite is an empty Database

  "Cofoundry": {
    "Database": {
      "ConnectionString": "Server=(localdb)\\mssqllocaldb;Database=MyCofoundrySite;Integrated Security=True;MultipleActiveResultSets=True"
    }
  }
  1. Build and publish and run it with .net8 runtime 6) Go to : http://localhost:5000/

Actual Result:

Empty page with errors : image

Exceptions (if any)

No response

.NET Version

8.0.100-rc.1.23415.7

Anything else?

dotnet info:

.NET SDK:
 Version:    8.0.100-rc.1.23415.7
 Commit:    18fe2525ea

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22000
 OS Platform: Windows
 RID:         win10-x64
 Base Path:    C:\Program Files\dotnet\sdk\8.0.100-rc.1.23415.7\

.NET workloads installed:
There are no installed workloads to display.

Host:
  Version:      8.0.0-preview.7.23370.6
  Architecture: x64
  Commit:       ebd23467f0
  RID:          win-x64

.NET SDKs installed:
  8.0.100-rc.1.23415.7 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.0-rc.1.23414.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
 Microsoft.NETCore.App 8.0.0-rc.1.23414.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.WindowsDesktop.App 8.0.0-rc.1.23412.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

@dotnet-actwx-bot @dotnet/compat

Junjun-zhao commented 1 year ago

@mkArtakMSFT This issue is found during .NET 8 RC1 validation. Could you please confirm whether it is a blocker for RC1? Thanks.

mkArtakMSFT commented 1 year ago

@javiercn can you please give this scenario a try and see if this is an issue with our framework, or with the dependency?

Junjun-zhao commented 1 year ago

@javiercn Do you have any update for this issue? Thanks for helping investigate it.

Junjun-zhao commented 12 months ago

@javiercn @mkArtakMSFT Thank you for checking this issue. Now we are RC2 validation, this issue still repro. Do you have a try for this scenario? If so, is it an issue for our Framework? If no, do you have any plans for it?

PriyaPurkayastha commented 11 months ago

@Junjun-zhao what is the behavior on .NET7? The repro information indicates this was passing in .NET6 and failed in .NET8 RC1. Verify Scenarios: 1). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.100-rc.1.23415.7: Fail 2). Windows 10 21H2 AMD64 + dotnet-sdk-6.0.413-win-x64: Pass 3). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.100-rc.1.23412.1: Pass Can you check and clarify the behavior with .NET 7 or other .NET 8 Previews? That will help narrow down the release where this change was introduced.

mkArtakMSFT commented 11 months ago

Can you check and clarify the behavior with .NET 7 or other .NET 8 Previews?

No need for verifying other .NET 8 Previews. Just the latest 7.0 and 8.0-rc2 please.

Junjun-zhao commented 11 months ago

No need for verifying other .NET 8 Previews. Just the latest 7.0 and 8.0-rc2 please.

It works on the latest 7.0, the latest 8.0-rc2 is not working. And it fails starting with 8.0.100-rc.1.23415.7. I have updated the verification scenario as shown below, please let me know if anything is unclear.

Verify Scenarios: 1). Windows 10 21H2 AMD64 + dotnet-sdk-6.0.413-win-x64: Pass 2). Windows 10 21H2 AMD64 + dotnet-sdk-7.0.402-win-x64: Pass 3). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.100-rc.1.23412.1: Pass 4). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.100-rc.1.23415.7: Fail 5). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.100-rc.2.23472.8: Fail

Junjun-zhao commented 11 months ago

Verified with the latest RC2 coherent build dotnet-sdk-8.0.100-rc.2.23477.19, the issue has fixed and does not repro.