I have two .NET Core 5.0 Razor Page Model projects, almost identical, reside in the same solution. Have not been running for almost 4 months.
Now when I wish to make some changes. One of the project cannot run in debug mode. I am always getting the following error
{"tag":"dap.receive","timestamp":1625537078095,"metadata":{"connectionId":0,"message":{"type":"request","command":"launch","arguments":{"WebRoot":"xxxx\ApmtWeb\wwwroot","rootPath":"xxxx\ApmtWeb\wwwroot","__workspaceFolder":"xxxx\ApmtWeb\wwwroot","runtimeExecutable":"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe","runtimeArgs":[],"sourceMaps":true,"url":"http://localhost:5031/","trace":{"logFile":"yyyy\Temp\visualstudio-js-debugger.txt"},"port":54798,"launchUnelevated":false,"projectGuid":"cca052fc-e9e7-44d5-8299-28928d665223","userDataDir":"yyyy\Microsoft\VisualStudio\16.0_e9805624\WebTools\F17440DA_BBDA0153","breakOnLoad":true,"smartStep":true,"skipFiles":[],"showAsyncStacks":true,"timeout":10000,"cleanUp":"onlyTab","name":"Visual Studio launch configuration override","type":"pwa-msedge","request":"launch","continueOnDisconnect":true},"seq":2}},"level":0}
The xxxx and yyyy were obscured due to privacy
My launch settings
"ApmtWeb": { "commandName": "Project", "dotnetRunMessages": "true", "launchBrowser": true, "applicationUrl": "http://localhost:5031", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }
I am able to see my web page if I manually type in the URL http://localhost:5031, before the above error shows and forcing it to shutdown.
There is not such setting inside my entire solution as http://localhost:54798, and I can't find any reference to 54798 even if I do a global search.
Restart your Application Pool. Check that your Web Application folder has the right permissions. Make sure that you give IIS_IUSRS, IUSR, or the specific user associated with the Application Pool read and execute rights for the Web Application folder. Fix the issue and restart your Application Pool.
In the Visual Studio toolbar, make sure the configuration is set to Debug. To start debugging, select the profile name in the toolbar, such as <project profile name>, IIS Express, or <IIS profile name> in the toolbar, select Start Debugging from the Debug menu, or press F5.
Open the Debug view by selecting the Debugging icon on the left side menu. Select the green arrow at the top of the pane, next to . NET Core Launch (console). Other ways to start the program in debugging mode are by pressing F5 or choosing Run > Start Debugging from the menu.
How to not launch a browser. Go to the launchSettings.json file in your Visual studio project, look for the following line. This will stop it from launching a browser at all. JavaScript debugging for ASP.Net defines if the browser will open in a new tab or a whole new browser window.
Users have reported that VS can sometimes cache some stale data and cause debugging sessions to fail where it was previously working. If debugging in the browser works, it indicates that this might be the issue. Sorry, something went wrong. What is the standard output displayed for your application?
To enable Razor runtime compilation till ASP.NET Core 3.1. Till now, if you need to enable Razor runtime compilation, you will follow the below steps. Install the Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation NuGet package. Update the project’s Startup.ConfigureServices method to include a call to AddRazorRuntimeCompilation .
I thought it would be nice to have Visual Studio launch Chrome with the developer tools window already open. After doing some digging, I discovered that Chrome has a command line option to open devtools: --auto-open-devtools-for-tabs. This should be simple enough – just configure a new browser for Visual Studio to use.
When I learned from one of the comments that this is a VS bug, I immediately tried the following:
Worked for me. Saved me from actually reinstalling VS ;-)
You can also disable the debugging of JS by VS, vis the Options menu so you just debug in Chrome (F12). Unchecking this feature, press F5, then stop it, the check it again also fixes the problem.
Such black magic :/
It is not necessary to delete the whole .vs folder, just go to .vs/project/ and delete the debuggerConfiguration -... json file. It is important to close any browser windows that have remained open before running the project again, otherwise it will recreate the debuggerConfiguration -... json file but it still gives an error.
.vs/project/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With