vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

[Linux] After logging into the AAD/AADB2C Standalone project account, debugging stops and some errors appear in the debug console.

Open LuckyKang79 opened this issue 2 years ago • 12 comments

Environment data

dotnet --info output:

.NET SDK (reflecting any global.json):
 Version:   6.0.414
 Commit:    bf51579d4c

Runtime Environment:
 OS Name:     debian
 OS Version:  11
 OS Platform: Linux
 RID:         debian.11-x64
 Base Path:   /usr/share/dotnet/sdk/6.0.414/

global.json file:
  Not found

Host:
  Version:      6.0.22
  Architecture: x64
  Commit:       ad40cc35b5

.NET SDKs installed:
  6.0.414 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.22 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.22 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

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

Learn about .NET Runtimes and SDKs:
  https://aka.ms/dotnet/runtimes-sdk-info

VS Code version: 1.81.1 C# Extension version: v2.0.376

OmniSharp log

logcrbug/1173575, non-JS module files deprecated. Debugging hotkey: Shift+Alt+D (when application has focus) blazor Loaded 9.14 MB resources This application was built with linking (tree shaking) disabled. Published applications will be significantly smaller. info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2] Authorization failed. These requirements were not met: DenyAnonymousAuthorizationRequirement: Requires an authenticated user.

Steps to reproduce

  1. Create Blazor WASM project via Terminal Emulator dotnet new blazorwasm -au IndividualB2C --aad-b2c-instance "https://blazorb2cvalidation.b2clogin.com/" -ssp "B2C_1_BlazorSignUpSignInTest" --client-id "b2e38967-fd3d-4bac-b371-50f00c422a90" --domain "blazorb2cvalidation.onmicrosoft.com" -o BlazoADDb2cstand
  2. Open the project using VS Code
cd BlazoADDb2cstand
code .
  1. After C# reloads the project, the IDE requests that assets (launch.json and task.json) should be added to build and debug the project. Select Yes. image
  2. Update the 'applicationUrl' in the launchSetting.json file as following: image
  3. F5 -> wait for the page loads successfully,
  4. Login the account

Note:

1.This issue also repro on lower versions of C# v2.0.357 2. This issue does not reproduce on lower versions of C# v1.26.0 3. This issue does not reproduce on Windows 4. This issue does not reproduce on Redirect log in Mode

Expected behavior

After logging into the AAD/AAD B2C Standalone project account, debugging does not stop and there are no errors in the debug console.

Actual behavior

After logging into the AAD/AADB2C Standalone project account, debugging stops and some errors appear in the debug console. bug image

Additional context

Add any other context about the problem here.

LuckyKang79 avatar Aug 22 '23 10:08 LuckyKang79

I will try to reproduce it today.

thaystg avatar Aug 23 '23 12:08 thaystg

This issue is also reproduced on latest version .NET 8.0.100-rc.1.23423.3 + C# v2.0.413

VS Code version: 1.81.1 C# Extension version: v2.0.413

dotnet --info output:

.NET SDK:
 Version:   8.0.100-rc.1.23423.3
 Commit:    94c9cdafbf

Runtime Environment:
 OS Name:     debian
 OS Version:  11
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/8.0.100-rc.1.23423.3/

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

Host:
  Version:      8.0.0-rc.1.23419.4
  Architecture: x64
  Commit:       92959931a3
  RID:          linux-x64

.NET SDKs installed:
  8.0.100-rc.1.23423.3 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.0-rc.1.23421.29 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.0-rc.1.23419.4 [/usr/share/dotnet/shared/Microsoft.NETCore.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

LuckyKang79 avatar Aug 25 '23 06:08 LuckyKang79

This issue is also reproduced on latest version 8.0.100-rc.2.23461.1 SDK + C# Dev Kit v0.4.10 preview (C# v2.1.2)

VS Code version: 1.82.0 C# Extension version: v2.1.2

LuckyKang79 avatar Sep 12 '23 06:09 LuckyKang79

@LuckyKang79 when you say debugging stops, do you mean that the application crashes?

ryzngard avatar Sep 19 '23 00:09 ryzngard

@ryzngard The application used is only VsCode and the application does not crash when debugging is stopped.

Also for more details, you can refer to the gif of the actual behavior of this issue.

LuckyKang79 avatar Sep 19 '23 01:09 LuckyKang79

@thaystg were you able to reproduce this?

@LuckyKang79 are you seeing any messages other than the Authorization Failed messages?

ryzngard avatar Sep 20 '23 23:09 ryzngard

Yes. I can reproduce it.

thaystg avatar Sep 21 '23 12:09 thaystg

@ryzngard There was the following error message in today's test for AAD Standalone project:

Details info: SDK: 7.0.402 Runtime:7.0.12 VS Code version: 1.82.2 C# Dev Kit version: v0.4.10 preview (C# v2.3.27)

Error Message: 7.0 AAD Standalone image

crbug/1173575, non-JS module files deprecated. Debugging hotkey: Shift+Alt+D (when application has focus) blazor Loaded 9.60 MB resources This application was built with linking (tree shaking) disabled. Published applications will be significantly smaller. info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2]      Authorization failed. These requirements were not met:      DenyAnonymousAuthorizationRequirement: Requires an authenticated user. Could not read source map for https://aadcdn.msftauth.net/shared/1.0/content/js/oneDs_f2e0f4a029670f10d892.js: Unexpected 404 response from https://aadcdn.msftauth.net/shared/1.0/content/js/oneDs_f2e0f4a029670f10d892.js.map: <Error><Code>BlobNotFound</Code><Message>The specified blob does not exist. RequestId:3774358f-601e-0071-3020-ed8324000000 Time:2023-09-22T06:44:07.6971492Z</Message></Error> TypeError: Failed to fetch    at a (:1:36425)    at at.initAsync (:1:36051)    at Vt (:1:60653)    at :1:63609    at https://localhost:7056/_framework/blazor.webassembly.js:1:63686 {stack: 'TypeError: Failed to fetch    at a (https://…7056/_framework/blazor.webassembly.js:1:63686', message: 'Failed to fetch'}

LuckyKang79 avatar Sep 22 '23 07:09 LuckyKang79

In recent testing, the following three debugging methods were tried. According to this document: debugging The first two methods do not reproduce this issue, and the last method reproduces this issue. Details are as follows:

  1. Click the solution > Debug > Start New Instance (this issue does not repro) image

  2. Click the project > Ctrl +shift + p > enter debug > Select and Start Debugging > C# >C#: BlazorAADSrandTest to run the project. (this issue does not repro) image

  3. Click the project > Ctrl +shift + p > enter debug > Select .NET Generate Assets for build and Debug -> F5 (This issue is repro) image

image Generate file; image

Details info: SDK: 8.0.100-rtm.23516.5 Runtime: 8.0.0-rtm.23511.16 VS Code version: 1.83.1 C# Dev Kit version: v0.5.150 (C# v2.6.24)

LuckyKang79 avatar Oct 17 '23 05:10 LuckyKang79

This issue is also reproduce on latest build of 9.0.100-preview.4.24257.5 SDK + C# Dev Kit v1.5.20 preview (C# v2.28.11) VS Code version: 1.89.0

Error Message: 9.0 AADB2C project: image

EmilyFeng97 avatar May 09 '24 07:05 EmilyFeng97

If you are not debugging are you able to login without any problem?

thaystg avatar May 09 '24 11:05 thaystg

If you are not debugging are you able to login without any problem?

This issue is not reproduced when running it using dotnet run or clicking on the solution in vs code > select Debug > Start without Debugging. This issue only repro when run the configuration through the Command Palette (Ctrl+Shift+P): Click the project > Ctrl +shift + p > enter debug > Select .NET Generate Assets for build and Debug -> F5. You can get more info form this comments.

image

EmilyFeng97 avatar May 10 '24 04:05 EmilyFeng97