Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code highlighted as CSHTML when it is C# #32604

Closed
BeepBot99 opened this issue May 19, 2024 · 1 comment · Fixed by #32609
Closed

Code highlighted as CSHTML when it is C# #32604

BeepBot99 opened this issue May 19, 2024 · 1 comment · Fixed by #32609
Assignees
Labels
aspnet-core/svc security/subsvc seQUESTered Identifies that an issue has been imported into Quest. Source - Docs.ms Docs Customer feedback via GitHub Issue

Comments

@BeepBot99
Copy link

BeepBot99 commented May 19, 2024

Description

This code is highlighted as CSHTML when it is actually C# in program.cs.

using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using WebMVCauth.Data;

var builder = WebApplication.CreateBuilder(args);

var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
builder.Services.AddDbContext<ApplicationDbContext>(options =>
    options.UseSqlServer(connectionString));
builder.Services.AddDatabaseDeveloperPageExceptionFilter();

builder.Services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
    .AddEntityFrameworkStores<ApplicationDbContext>();
builder.Services.AddControllersWithViews();

var app = builder.Build();

if (app.Environment.IsDevelopment())
{
    app.UseMigrationsEndPoint();
}
else
{
    app.UseExceptionHandler("/Home/Error");
    app.UseHsts();
}

app.UseHttpsRedirection();
app.UseStaticFiles();

app.UseRouting();

app.UseAuthentication();
app.UseAuthorization();

app.MapControllerRoute(
    name: "default",
    pattern: "{controller=Home}/{action=Index}/{id?}");
app.MapRazorPages();

app.Run();

Page URL

https://learn.microsoft.com/en-us/aspnet/core/security/authentication/scaffold-identity?view=aspnetcore-8.0&tabs=visual-studio#scaffold-identity-into-an-mvc-project-without-existing-authorization

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/security/authentication/scaffold-identity.md

Document ID

3e25547b-e2c9-6634-2c38-2a77207f17d4

Article author

@Rick-Anderson


Associated WorkItem - 256626

Rick-Anderson added a commit that referenced this issue May 20, 2024
@Rick-Anderson Rick-Anderson self-assigned this May 20, 2024
@Rick-Anderson Rick-Anderson added reQUEST Triggers an issue to be imported into Quest and removed ⌚ Not Triaged labels May 20, 2024
Rick-Anderson added a commit that referenced this issue May 20, 2024
* Update scaffold-identity.md

Fixes #32604

* Update aspnetcore/security/authentication/scaffold-identity.md
@Rick-Anderson
Copy link
Contributor

@BeepBot99 thanks for letting us know and showing exactly where the change needed to be made.

Check out is:issue is:open label:"code help wanted" " and is:open is:issue label:"Good first issue" if you're interested it writing some code. We'll take care of the writing.

@sequestor sequestor bot added seQUESTered Identifies that an issue has been imported into Quest. and removed reQUEST Triggers an issue to be imported into Quest labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aspnet-core/svc security/subsvc seQUESTered Identifies that an issue has been imported into Quest. Source - Docs.ms Docs Customer feedback via GitHub Issue
Projects
Development

Successfully merging a pull request may close this issue.

3 participants