title: VS2019 ,NET Core 5.0 Razor Pages ~ Unable to launch browser could not connect to debug target
body: <p>I have <strong>two</strong> .NET Core 5.0 Razor Page Model projects, almost identical, reside in the same solution. Have not been running for almost 4 months.</p>
  <p>Now when I wish to make some changes. <strong>One</strong> of the project cannot run in debug mode. I am always getting the following error</p>
  <p><a href="https://i.stack.imgur.com/mMOBj.png" rel="noreferrer"><img src="https://i.stack.imgur.com/mMOBj.png" alt="Error when launch with debug" /></a></p>
  <blockquote>
  <p>{&quot;tag&quot;:&quot;dap.receive&quot;,&quot;timestamp&quot;:1625537078095,&quot;metadata&quot;:{&quot;connectionId&quot;:0,&quot;message&quot;:{&quot;type&quot;:&quot;request&quot;,&quot;command&quot;:&quot;launch&quot;,&quot;arguments&quot;:{&quot;WebRoot&quot;:&quot;xxxx\ApmtWeb\wwwroot&quot;,&quot;rootPath&quot;:&quot;xxxx\ApmtWeb\wwwroot&quot;,&quot;__workspaceFolder&quot;:&quot;xxxx\ApmtWeb\wwwroot&quot;,&quot;runtimeExecutable&quot;:&quot;C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe&quot;,&quot;runtimeArgs&quot;:[],&quot;sourceMaps&quot;:true,&quot;url&quot;:&quot;http://localhost:5031/&quot;,&quot;trace&quot;:{&quot;logFile&quot;:&quot;yyyy\Temp\visualstudio-js-debugger.txt&quot;},&quot;port&quot;:54798,&quot;launchUnelevated&quot;:false,&quot;projectGuid&quot;:&quot;cca052fc-e9e7-44d5-8299-28928d665223&quot;,&quot;userDataDir&quot;:&quot;yyyy\Microsoft\VisualStudio\16.0_e9805624\WebTools\F17440DA_BBDA0153&quot;,&quot;breakOnLoad&quot;:true,&quot;smartStep&quot;:true,&quot;skipFiles&quot;:[],&quot;showAsyncStacks&quot;:true,&quot;timeout&quot;:10000,&quot;cleanUp&quot;:&quot;onlyTab&quot;,&quot;name&quot;:&quot;Visual Studio launch configuration override&quot;,&quot;type&quot;:&quot;pwa-msedge&quot;,&quot;request&quot;:&quot;launch&quot;,&quot;continueOnDisconnect&quot;:true},&quot;seq&quot;:2}},&quot;level&quot;:0}</p>
  </blockquote>
  <p>The xxxx and yyyy were obscured due to privacy</p>
  <p>My launch settings</p>
  <blockquote>
  <p>&quot;ApmtWeb&quot;: {
  &quot;commandName&quot;: &quot;Project&quot;,
  &quot;dotnetRunMessages&quot;: &quot;true&quot;,
  &quot;launchBrowser&quot;: true,
  &quot;applicationUrl&quot;: &quot;http://localhost:5031&quot;,
  &quot;environmentVariables&quot;: {
  &quot;ASPNETCORE_ENVIRONMENT&quot;: &quot;Development&quot;
  }
  }</p>
  </blockquote>
  <p>I am able to see my web page if I manually type in the URL <strong>http://localhost:5031</strong>, before the above error shows and forcing it to shutdown.</p>
  <p>There is not such setting inside my entire solution as <strong>http://localhost:54798</strong>, and I can't find any reference to <strong>54798</strong> even if I do a global search.</p>