简体   繁体   English

当我在 IIS 上发布 asp net core 5 项目时出现错误

[英]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.

相关问题 发布到IIS 7.5时ASP.NET Core 404错误 - ASP.NET Core 404 Error When Published to IIS 7.5 仅当在 IIS 中发布时,在 ASP.net Core 3.1 WebAPI 中启用 CORS 时出错 - Error on Enable CORS in ASP.net Core 3.1 WebAPI in only when published in IIS 我发布了我的 ASP.NET Core 6 项目,它发布成功,但是当我 run.exe 文件说 ConnectionString 不能是 null - I published my ASP.NET Core 6 project it published successfully, but when I run .exe file that say ConnectionString cannot be null asp .net core api 发布在 iis 原因(本地主机当前无法处理此请求。Z293C9ZEA246FF9985866F) - asp .net core api published on iis cause (localhost is currently unable to handle this request. HTTP ERROR 500) 启动应用程序时发生错误,一旦我在 IIS 上运行我的 ASP.NET 核心项目 - An error occurred while starting the application, once I run my ASP.NET Core project on IIS 发布到IIS时,ASP.NET MVC WebApi应用程序上的程序集绑定错误 - Assembly binding error on ASP.NET MVC WebApi application when published to IIS ASP.NET Core 5 Web API with Entity Framework works when running in IDE but not when published to folder and installed in IIS - ASP.NET Core 5 Web API with Entity Framework works when running in IDE but not when published to folder and installed in IIS 发布到IIS时无法从DotNetCore调用.NET 4.6.1项目 - Unable to call .NET 4.6.1 project from DotNetCore when published to IIS Asp.NET 发布到 IIS 服务器时显示“目录无效” - Asp.NET shows "The Directory is invalid" when published to IIS server 发布时,Asp.NET Core控制器操作返回404 - Asp.NET Core controller action returns 404 when published
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM