question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scaffolding Identity Deletes All Content in site.css and site.js

See original GitHub issue

From @jkotas on October 8, 2018 4:34

From @robinwilson16 on October 7, 2018 22:5

Each time I scaffold identity in a project by right-clicking the project and go to New… > Scaffolded Item and and select Identity and add all pages I then find this deletes all content in site.css and site.js.

After scaffolding site.js contains this code only:

// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.

// Write your JavaScript code.

And site.css has this:

/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification\ 
for details on configuring this project to bundle and minify static web assets. */
body {
    padding-top: 50px;
    padding-bottom: 20px;
}

/* Wrapping element */
/* Set some basic padding to keep content from hitting the edges */
.body-content {
    padding-left: 15px;
    padding-right: 15px;
}

/* Carousel */
.carousel-caption p {
    font-size: 20px;
    line-height: 1.4;
}

/* Make .svg files in the carousel display properly in older browsers */
.carousel-inner .item img[src$=".svg"] {
    width: 100%;
}

/* QR code generator */
#qrCode {
    margin: 15px;
}

/* Hide/rearrange for smaller screens */
@media screen and (max-width: 767px) {
    /* Hide captions */
    .carousel-caption {
        display: none;
    }
}

This has happened to me a few times now and over the last 3 VS updates (at least) and I have only just tracked down the connection. Current version is 15.8.6.

The workaround is to take backups of these files and then overwrite changes back after scaffolding. As I don’t commit constantly I have lost a few changes each time so would be good if this bug could be fixed.

Robin

Copied from original issue: dotnet/corefx#32681

Copied from original issue: aspnet/Home#3595

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bganathanbryantcommented, Dec 2, 2019

This issue is fixed in the latest update.

I’ve just received this same issue. Still happening when all identity is scaffolded.

1reaction
vijayrkncommented, Oct 22, 2018

This issue is fixed in the latest update.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scaffold Identity in ASP.NET Core projects
Learn how to scaffold Identity in an ASP.NET Core project.
Read more >
Why will the AspNetCore Identity scaffolding not load its ...
The answer in that question mentions grabbing the CSS and JS files by running as Development and navigating to the files directly, and...
Read more >
Customising the ASP.NET Core default UI without editing ...
In this case, I'm going to scaffold the Account.Register page, and remove the external login provider section completely. You can create a Razor ......
Read more >
Using Scaffolding to Create MVC Applications with Visual ...
Net MVC builds, such as data access and Web API. ... You will see that the ' Edit', ' Details', and ' Delete'...
Read more >
Asp.Net Core MVC & Identity UI - User Registration and Login
Recommended Courses ➤ Asp.Net Core Web API ... This channel is all about teaching and motivating software developers to build applications/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found