[英]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.当我在 Visual Studio 2019 中运行我的项目时很好,但是当我在 IIS 上发布我的项目时发生错误。
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;我正在使用 mediatr 5 层清洁; I register MediatR on Startup but the error is not solve.我在启动时注册了 MediatR,但错误没有解决。
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.一种简单的方法是在应用程序的入口点引入一分钟延迟,这样您就有时间附加到 w3wp 进程以在启动时捕获异常。 Make sure "Just My Code" is disabled.确保禁用“仅我的代码”。
the Problem was about Db connection and i add access of user: 'IIS APPPOOL\tqcApi' in database问题与 Db 连接有关,我在数据库中添加了用户访问权限:'IIS APPPOOL\tqcApi'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.