In SharePoint 2019 solution, I have the below code that loads a "user control.ascx" to a normal SharePoint web part
this._pager = (HTMLPager)this.Page.LoadControl(@"~/_controltemplates/Emp/EpmPager.ascx");
base.CreateChildControls();
this.Controls.Add(this._pager);
I perform built and deploy for this solution with no errors, but when I add the web part to a page I got this error The file 'UserControl.ascx' does not exist
The file '/_ControlTemplates/Emp/Emp.ascx' does not exist.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The file '/_ControlTemplates/Emp/Emp.ascx' does not exist.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): The file '/_ControlTemplates/Emp/Emp.ascx' does not exist.]
System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) +162
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +146
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +131
System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) +71
System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) +78
CQWPWithPager.WebPartCode.WebPart1.WebPart1.CreateChildControls() +163
System.Web.UI.Control.EnsureChildControls() +130
System.Web.UI.Control.PreRenderRecursiveInternal() +66
System.Web.UI.Control.PreRenderRecursiveInternal() +276
System.Web.UI.Control.PreRenderRecursiveInternal() +276
System.Web.UI.Control.PreRenderRecursiveInternal() +276
System.Web.UI.Control.PreRenderRecursiveInternal() +276
System.Web.UI.Control.PreRenderRecursiveInternal() +276
System.Web.UI.Control.PreRenderRecursiveInternal() +276
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6881
I am using Visual Studio 2022, How can solve this error?