Identity Scaffolding on Ubuntu 20.04 using incorrect file paths
See original GitHub issueOutput of dotnet --info
:
.NET Core SDK (reflecting any global.json):
Version: 3.1.302
Commit: 41faccf259
Runtime Environment:
OS Name: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: linux-x64
Base Path: /usr/share/dotnet/sdk/3.1.302/
Host (useful for support):
Version: 3.1.6
Commit: 3acd9b0cd1
.NET Core SDKs installed:
3.1.302 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
While following the Microsoft docs guide on scaffolding Identity, I was unable to scaffold Identity, presumably because the scaffolder is looking for files with the naming pattern Filename.cs.cshtml
instead of Filename.cshtml.cs
.
I initially tried scaffolding with a netcoreapp3.1
with Microsoft.VisualStudio.Web.CodeGeneration.Design 3.1.4
, but when this failed I tried with netcoreapp3.0
and Microsoft.VisualStudio.Web.CodeGeneration.Design 3.0.0
. Both runs were identical.
Steps to reproduce:
- Install the code generator:
dotnet tool install -g dotnet-aspnet-codegenerator
- Create a project to scaffold into:
dotnet new mvc -n IdentityApp -au Identity
cd
into the new project directory- Install
Microsoft.VisualStudio.Web.CodeGeneration.Design
- Install
Microsoft.EntityFrameworkCore.SqlServer
because scaffolding doesn’t seem to work without it - Build the project to make sure everything works (build OK)
- Scaffold all Identity pages:
dotnet aspnet-codegenerator identity -dc IdentityApp.Data.ApplicationDbContext
Expected behavior:
All Identity.UI Razor Pages are scaffolded into the project
Actual behavior:
A fatal error indicating a file was not found:
Building project ...
Finding the generator 'identity'...
Running the generator 'identity'...
A file matching the name Account.AccessDenied.cs.cshtml was not found within any of the folders:
at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.<BuildCommandLine>b__6_0()
at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.Execute(String[] args)
at Microsoft.VisualStudio.Web.CodeGeneration.CodeGenCommand.Execute(String[] args)
RunTime 00:00:16.85
Additional information about the project being scaffolded, such as:
Target framework(s): netcoreapp3.1 and netcoreapp3.0
Package version of Microsoft.VisualStudio.Web.CodeGeneration.Design - this may be added to your project by scaffolding: 3.1.4 (netcoreapp3.1) and 3.0.0 (netcoreapp3.0)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:15 (3 by maintainers)
Top Results From Across the Web
Identity Scaffolding on Ubuntu 20.04 using incorrect file ...
I was having an issue with Omnisharp not being able to generate my razor pages. The link @vladimir provided, I found that running...
Read more >Scaffold Identity in ASP.NET Core projects
This document explains the steps needed to complete an Identity scaffolding update. We recommend using a source control system that shows ...
Read more >Newest 'asp.net-core-scaffolding' Questions - Stack Overflow
Identity Scaffolding on Ubuntu 20.04 using incorrect file paths dotnet 5. Output of dotnet --info: .NET SDK (reflecting any global.json): Version: 5.0.101 ...
Read more >[Fix]-How do I include pictures into my Razor Page project?
Identity Scaffolding on Ubuntu 20.04 using incorrect file paths dotnet 5 · How to set appsettings.json automatically for deployment in ASP.NET Core?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks that’s a decent workaround for now.
I guess the dotnet guys are all using windows else they’d have encountered this problem themselves. 😝
I hope it gets some attention soon, as scaffolding is totally broken in linux / net5. And it’s so useful.
@lonix1 @rolambert @KBastin @tedesco8 @christianspeegle I have a fix for this issue out with a new 3.1.5 and 5.0.2 package out. Use dotnet tool update dotnet-aspnet-codegenerator -g --version 3.1.5/5.0.2 depending on if you are targeting .netcoreapp3.1 or net5.0. I would like it if someone could confirm the fix before I close the issue.
Apologize for the lengthy delay on this fix and appreciate all the feedback.