Views/Shared/_Layout.cshtml not updated when scaffolding identity in 2.2 release
- Dominant language
- C#
- Stars
- 818
- Forks
- 260
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 10
Description
## Steps to reproduce:
**Install release version of SDK 2.2 on Mac**
```sh
dotnet --version
```
> 2.2.100
```sh
dotnet new mvc
```
Then init a git repo with suitable .gitignore and commit everything so we can easily see what was changed.
**Add the scaffolded identity files:**
```sh
dotnet tool update --global dotnet-aspnet-codegenerator
```
> Tool 'dotnet-aspnet-codegenerator' was successfully updated from version '2.1.6' to version '2.2.0'.
Add this to csproj file as requested when attempting to run the generator:
``
```sh
dotnet restore
```
Run the code generator:
```sh
dotnet-aspnet-codegenerator identity
```
> Building project ...
Finding the generator 'identity'...
Running the generator 'identity'...
RunTime 00:00:12.66
**Run the app and notice there is no "Login" link in the nav bar.**
Checking the contents of "Views/Shared/_Layout.cshtml" shows that the file "Views/Shared/_LoginPartial.cshtml" which was added by the code generator is not referenced and git shows no changes to the file.
Despite the lack of warning about updating existing file, run the generator again with the '--force' option:
Run the code generator with --force:
```sh
dotnet-aspnet-codegenerator identity --force
```
No difference.
Running:
```sh
dotnet-aspnet-codegenerator -h
```
shows there the force option is no longer there?
## Expected behavior:
It should not generate broken scaffolding, the "Login" link should be there, it should work as it did previously in 2.1.
## Actual behavior:
Code generator generates broken scaffolding for identity
## Workaround:
This is easily be fixed by adding the partial to _Layout.cshtml, right after the navbar markup:
```
```
Seems there is also another issue with identity scaffolding, which i think also existed in 2.1
https://github.com/aspnet/Scaffolding/issues/884
Contributor guide
Assessment
This issue has not been assessed yet.