asp.net core 3.1 accountcontroller missing when creating new project - asp.net-core

when I create a new project asp.net core 3.1 with Visual Studio with Individual User Accounts selected.
I can't find the Account Controller folder. There is an Areas folder but almost empty
Identity is working but where are the codes?

You are looking for scaffold identity

To add Identity scaffolding to a project, read:
https://learn.microsoft.com/en-us/aspnet/core/security/authentication/scaffold-identity?view=aspnetcore-3.1&tabs=netcore-cli#scaffold-identity-into-an-empty-project
However for .Net 3.1, you’ll need to add these via NuGet and select the 3.x.x versions, else dotnet will try to install the latest .Net 6 which is incompatible with .Net3.1…
Also, having done all that, you get the Area/Identity/Pages/Account folder with more .cshtml files. But still don't see the AccountController in the Controllers folder.
It turns out the code for each operation is in the .cs files for each of the views in the Account folder, per Razor page paradigm.

Related

could not run the ASP.NET Core MVC application

when i run the ASP.NET Core MVC application from Visual studio 2022, it getting conflicts with source and module file(please refer the attached image.)
We are migrating MVC5 project to ASP.NET Core MVC and i dont know these initial configuration settings
Pls assist me on this
Thanks
I need to run the application in the browser.
Please delete the bin folder and rebuild your project.

How to create whole solution from published files of an asp.net core 3.1 project?

I lost one week of development because of not committing my code. I work on a personal project and I lost my code I only have the published version of my asp.net core 3.1 project. and my code is not obfuscated.
I use DotPeek to open my main dll and I get controllers but there are no views in there ? I wonder to know, is there any way for me to create a solution like I had without creating views by my hand?
Is it possible to completely regenerate Visual Studio solution folder for this project from Published files?

ASP.NET Core 1.1 Identity dependencies and all Data Access in a separate class library project

I have extracted most of the Database related code from an ASP.NET Core Web Application project with Individual User Accounts, ie. Identity into an ASP.NET Class Library project. I am now stuck in the final pieces which is to remove the concrete assignment to EF Core and moving the connection strings to the Data project.
Here is what I have done so far:
Created a blank solution
Created an ASP.NET Core web
application (TestPatterns.Web) with Individual User Accounts
Updated all the Nuget packages
Created a Class Library Core
package
In the Class Library Project (TestPatterns.Data) Nuget ->
Removed the NetStandard Library 1.6, replaced with
Microsoft.NetCore.App 1.1.0
In the Class Library Project (TestPatterns.Data), added all the EF and
Identity Nuget Packages
Moved over of the 'Data' folder from the
Web application to the class library project
Moved over the
ApplicationUser.cs file from the Web Application to the class
library project folder Models
I end up with a structure like this:
To run a migration I execute the following on the Data project folder:
dotnet ef --startup-project ../TestPatterns2.Web migrations add first
Looking for some help on removing all dependencies of EF Core 1.1 from the Web project and moving the connection strings over. Also, would the DI remain in the Web project or should that move to the Data project also? If so, how?

asp.net core project occurs MissingMethodException

I create a new project with ASP.NET Core Web Application(.NET Core).
And it can work after building and running it.
I create a class library with .NET Core and move the files under Service folder in the web project to the library, then add the reference and change namespace in the controllers.
It occurs MissingMethodException after registering a new user.
Asp.net core project seems not able to use class library outside the web project.
The detailed message is as the below.
In ASP.NET Core , everything is in form of nuget packages, hence you might have to create nuget package from the class library and then add it to the current solution.
Hope this information helps.

Can I use Nuget to install MVC 4 into Webforms, or is it better to merge MVC config into Webforms, for incremental conversion

Times have changed--now we have Visual Studio 2012, MVC 4, Nuget--and it seems like the procedures in the Hanselman blog and the more recent Channel 9 tutorial could be enhanced. Both Hanselman and Kane recommend using DIFF tools to merge MVC functionality into the Web Forms Project (to endow the webform's .csproj and web.config etc with MVC). However now that Nuget manages packages, I wonder if it would be easier to merely install MVC 4 into the Web Forms project using Nuget; while of course following the procedures in the blog and the channel 9 demo for incrementally upgrading the Webforms project, including dealing with aspx login controls that postback, ascx user controls, and changing base classes Page to ViewPage and MasterPage to ViewMasterPage.
Has anyone tried to use Nuget to endow a Webforms project with MVC 4, and if so, would you recommend that technique?
UPDATE
I am following the Kane method which is an ordered set of guidelines (like modifying a complicated recipe in cooking) and am using NuGet to avoid some tedium. The guideline requires you make a dummy MVC project and compare it to your ASP.NET project to see what you need to add to your original project. You can add stuff using NuGet GUI, but that gets you latest stable assemblies versions which may lead to the dark insane demon of incompatibility. Instead use the NuGet console command line to get the compatible versions listed in the dummy MVC project's packages.config as explained in the following: How to install an older version of package via NuGet?