Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
65 views
in Technique[技术] by (71.8m points)

c# - How Using UnitOfWork in TokeProvider?

I want inject unitOfWork to class providerToken . But my code gives a runtime error and the application stops Someone can help me

   public class TokenProvider : PhoneNumberTokenProvider<ApplicationUser>
    {
        public static string Phone = "Phone";
        public static string Email = "Email";

        private readonly IUnitOfWork _unitOfWork;
        public TokenProvider(IUnitOfWork unitOfWork)
        {
            this._unitOfWork = unitOfWork;
        }
}

Error


'iisexpress.exe' (CoreCLR: DefaultDomain): Loaded 'C:Program FilesdotnetsharedMicrosoft.NETCore.App5.0.2System.Private.CoreLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'G:ProjectMicroServices-IdentityIdentityMicroserviceAPIinDebug et5.0API.dll'. Symbols loaded. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.NETCore.App5.0.2System.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.AspNetCore.Server.IIS.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.AspNetCore.Hosting.Abstractions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.AspNetCore.Hosting.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.AspNetCore.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.Extensions.Configuration.Abstractions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.Extensions.DependencyInjection.Abstractions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.Extensions.DependencyInjection.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.Extensions.Logging.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.Extensions.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.NETCore.App5.0.2 etstandard.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.Extensions.Hosting.Abstractions.dll'. FilesdotnetsharedMicrosoft.NETCore.App5.0.2System.Transactions.Local.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request starting HTTP/1.1 GET http://localhost:1282/swagger/v1/swagger.json - - Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request finished HTTP/1.1 GET http://localhost:1282/swagger/v1/swagger.json - - - 200 - application/json;charset=utf-8 187.3716ms The program '[29676] iisexpress.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'. The program '[29676] iisexpress.exe: Program Trace' has exited with code 0 (0x0).

question from:https://stackoverflow.com/questions/65943063/how-using-unitofwork-in-tokeprovider

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...