Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapping of breakpoints drops pathname when it's part of the applicationurl #1308

Closed
joj opened this issue Jun 15, 2022 · 2 comments · Fixed by #1352
Closed

Mapping of breakpoints drops pathname when it's part of the applicationurl #1308

joj opened this issue Jun 15, 2022 · 2 comments · Fixed by #1352
Assignees
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug verification-steps-needed Steps to verify are needed for verification
Milestone

Comments

@joj
Copy link
Member

joj commented Jun 15, 2022

Describe the bug
When the application root includes a pathname (which is very common for IIS), breakpoint resolution drops the pathname, resulting in the breakpoints not being resolved. For instance, in the attached logs the application root is "https://localhost/webapplication10", and the breakpoint is in "https://localhost/webapplication10/js/functions.js", but when resolving the path gets truncated to "https://localhost/js/functions.js".

To Reproduce
This is simplish to reproduce in VS, I'm not sure if it will be so simple to reproduce in vscode.
VS steps are:

  • Create ASP.Net (Model-View-Controller)
  • Open wwwroot/js, right click on the folder
  • Add New Item (javascript file) named "functions.js"
  • Added this code:
function display()
{
    alert("message");
}

  • Set a breakpoint on line 3 (where the alert is)
  • Open Views\Home, double click on Index.cshtml
  • Add the following script blocks at the end of the file:
  • <script src="~/js/functions.js"></script>
<script>
display();
</script>

  • Run

At this point, the breakpoint is hit. The root is "http://localhost:xxxx/"

  • Open the dropdown in the start button
  • Click on "WebApplication Debug Properties"
  • Click the first button (Create a New Profile)
  • In launchsettings.json (Properties), IIS should look like this:
  "IIS": {
     "commandName": "IIS",
     "launchBrowser": true,
     "environmentVariables": {
       "ASPNETCORE_ENVIRONMENT": "Development"
     }
(...)
 "iisSettings": {
   "windowsAuthentication": false,
   "anonymousAuthentication": true,
   "iis": {
     "applicationUrl": "https://localhost/WebApplication10",
     "sslPort": 0
   },

  • Run

At this point, the breakpoint will not be hit. The root is "https://localhost/appname"

Log File
visualstudio-js-debugger-pathname.txt

Additional Context
This issue was first reported here: https://developercommunity.visualstudio.com/t/After-the-1720-update-Visual-Studio-2/10054778

@joj joj added the bug Issue identified by VS Code Team member as probable bug label Jun 15, 2022
@connor4312 connor4312 added this to the July 2022 milestone Jul 11, 2022
@connor4312 connor4312 modified the milestones: July 2022, August 2022 Jul 29, 2022
@roblourens
Copy link
Member

Create ASP.Net (Model-View-Controller)

Sorry, what do I need to create?

@roblourens roblourens added the verification-steps-needed Steps to verify are needed for verification label Aug 25, 2022
@connor4312
Copy link
Member

@joj can you verify whether this was fixed for you with these changes?

@rzhao271 rzhao271 added the author-verification-requested Issues potentially verifiable by issue author label Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug verification-steps-needed Steps to verify are needed for verification
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants