What is the problem ASP.Net Core Error CS1061

Severity Code Description Project File Line Suppression State
Error CS1061 ‘IServiceCollection’ does not contain a definition for
‘AddDefaultIdentity’ and no accessible extension method
‘AddDefaultIdentity’ accepting a first argument of type
‘IServiceCollection’ could be found (are you missing a using directive
or an assembly
reference?) WebHesab C:UsersDELLsourcereposWebHesabWebHesabStartup.cs 36 Active

Is there any way to set a generic root path for content in ASP.NET Core?

I have faced problem with accessing static files from wwwroot folder in ASP.NET Core application in release mode. I keep my static files in wwwroot folder and access them with a relative path, for example to access wwwroot/images/test.png for src attribute of img tag I specify /images/test.png and the picture loads correctly in local IIS Express development mode.

How can I insert the current logged in user in a database using ASP.NET Core

I am trying to insert the current logged in user in a database. I had an idea of making a hidden input text field in the view, taking its value, and inputting it in the database using the asp-for. But it doesn’t seem to work. Can you please tell me what am I doing wrong and if you have any other suggestion on how to fix this in any other way, feel free to tell me.
Thank you in advance <3
This is the view code (P.S I took out some code of the view, I feel as though it is unnecessary for the questions purpose):