In a solution composed of several layers:
- BusinessEntity (Layer)
- DTO
- BeMonitorRequest.cs
- …other classes…
- DTO
- Web (Layer)
- Controllers
- MonitorController.cs
- …other controllers…
- Controllers
I am having an issue generating installation files using the ‘Publish’ option in VS2015. I generate the files in a specific folder and then copy and paste them into the production environment.
When I run the project from VS2015, I don’t encounter any problems, but after pasting the generated deployment files into the production environment, I get a 500 error.
This error occurs when trying to fetch the endpoint called “api/monitor/getMonitorCasesByFilter”. It is defined as follows in the Web layer controller:
[RoutePrefix("api/monitor")]
public class MonitorController : BaseController
{
private readonly ISelector iSelector;
private readonly IMonitorCase iMonitorCase;
private readonly ITimeConverter iTimeConverter;
public MonitorController(IMonitorCase iMonitorCase, ISelector iSelector, ITimeConverter iTimeConverter)
{
this.iMonitorCase = iMonitorCase;
this.iSelector = iSelector;
this.iTimeConverter = iTimeConverter;
}
[HttpGet]
[Route("getMonitorCasesByFilter")]
public IHttpActionResult CasesByFilter([FromUri] BeMonitorRequest request)
{
request.ProjectId = this.GetProject();
request.UserName = this.GetUserName();
List<BeMonitorCase> CasesByFilter = this.iMonitorCase.GetMonitorCasesMainByFilter(request);
return Ok(CasesByFilter);
}
}
The DTO definition is as follows:
using MyProject.BusinessEntity.DTO;
namespace MyProject.BusinessEntity.DTO
{
public class BeMonitorRequest
{
public int ProjectId { get; set; }
public string ProjectDB { get; set; }
public string From { get; set; }
public string To { get; set; }
public string RadNumber { get; set; }
public string UserName { get; set; }
public string FullName { get; set; }
public int ProcessId { get; set; }
public string ProcessName { get; set; }
public int TaskId { get; set; }
public string NotificationType { get; set; }
public int StepTypeId { get; set; }
public int WiClosed { get; set; }
public int WinClosed { get; set; }
}
}
Here some error samples:
In local host (it works)
In production env (it not work)
Some additional information:
-
My PC’s OS:
Windows 10 Enterprise
Version 22H2
OS Build 19045.4412 -
Server’s OS:
Windows Server 2022 Datacenter
Version 21H2
OS Build 20348.1906 -
Server’s IIS:
Version 10.0.20348.1 -
VS2015
Version 14.0.25431.01 Update 3 -
Project Target Framework
.Net Framework 4.5.2
Things I have tried:
- Cleaning and rebuilding project by project
- Cleaning and rebuilding the entire solution
I don’t know what else to try, please help.