简体   繁体   中英

when I published asp net core 5 project on IIS it has an error

when i run my project in visual studio 2019 is good but when i publish my project on IIS occurs an error.

An unhandled exception occurred while processing the request.
NullReferenceException: Object reference not set to an instance of an object.

i'm using mediatr an 5 Layers clean; I register MediatR on Startup but the error is not solve.

 services.AddMediatR(typeof(YarnSystemCommandDTO).GetTypeInfo().Assembly);
 services.AddScoped(typeof(IGenericRepository<>), typeof(GenericRepository<>));

To debug this situation, the callstack of the first chance exception will most like help. A simple way is to introduce a one-minute-delay to the entry point of your application, so you have time to attach to your w3wp process to catch the exception at startup. Make sure "Just My Code" is disabled.

the Problem was about Db connection and i add access of user: 'IIS APPPOOL\tqcApi' in database

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM