Debugger not working in visual studio - javascript

My debugger stopped working as expected in Visual Studio Community 2015 (Update 1).
The solution I'm working on has the following architecture:
"Query" project - written with angularjs 1.4
"Login" project - written with angularjs 1.4
More back-end projects - written with c#/web-api
I run the Query project, it checks for session and redirect to Login. After the login is successful it makes another redirect back to the Query url.
Until yesterday I had no issues debugging the whole solution from VS directly.
Now the behavior is that the first time I run the "Query" project, my breakpoints get hit. After coming back from Login, no breakpoint is hit.
Both client-side projects are hosted using IIS Express.
Things I tried until now:
clean, build, rebuild the solution;
attaching to process from VS. I attached to all IIS Express processes but with no luck;
closing VS and deleting my bin and obj folders from all projects;
restarting the machine;
Also good to mention that I have set in web.config:
<compilation debug="true"></compilation>
Any hint or idea is highly appreciated.

After trying more different solutions, the only thing that worked in my case was to unload/reload the project.
Also, now the breakpoints that I set before the application runs are no longer getting hit, but if I set them after the application started then they work fine.

I can suggest some Stack Overflow answers related to this issue, maybe it helps:
New project and just importing the files into it: Upgrade to Visual Sudio 2015 and now can't hit break points in debuging
Manual check of the Symbol Load Information: Fixing "The breakpoint will not currently be hit. No symbols have been loaded for this document."
Incorrect configuration selected in the debug menu: Visual Studio breakpoints not being hit

In my case (Vs2019) the Microsoft Symbol server was causing the issue.
It was not being able to attach Local IIS.
Enabling only the NuGet Symbol server and disabling the Microsoft worked for me

Related

Serving a project in Ember using `ember s` triggers file changed

So, I am serving an Ember using ember s command. Even though I do not make any changes to the code I keep seeing the entry file changed <fileName> in the server startup log, this makes the server start process really slow. I am using Windows 11, however this happened in windows 10 also, ember-cli version 3.8.3.
There is an issue raised in github with no solution - https://github.com/ember-cli/ember-cli/issues/9055. This is the only mention of this issue I could find.
Hope someone has a solution to this.

Javascript breakpoint not work in Visual Studio 2019 asp.net application

I recently upgraded from VS 2017 to VS 2019.
In VS 2017, when running an asp.net application locally, using Chrome, I could put a breakpoint in javascript code and the debugger would stop on the breakpoint. This no longer works in Visual Studio 2019.
What do I need to do to enable javascript debugging in Visual Studio 2019 using Chrome? I would like to be able to put breakpoints in javascript files and have them hit.
Here is my setup.
I've enabled Javascript debugging.
I put a breakpoint in my Javscript code. This breakpoint is in a *.js file (not inside a Razor view).
The breakpoint is ignored. Visual Studio very courteously shows me a tooltip telling me the breakpoint will be ignored.
It should work in VS2019+Chrome.(I just checked this in several machines)
This is not one issue can be resolved directly since many factors can cause this behavior, you can follow suggestions below to check if it helps:
1.Update your VS2019 to latest 16.3.7, update your chrome browser to latest 78.0.3904.87
2.Delete the bin and obj folders in your project directory => then close and restart VS => open that project and do a clean rebuild
3.Make sure you're in debug project mode, right-click your web project=>Set as StartUp project
Also, sometimes we need to wait for several seconds before the debug session starts successfully.(I once met same popup, then after several seconds it disappeared and everything worked)
Hope it helps :)
Besides enabling JavaScript debugging in Visual Studio, please ensure that minification is off. (Turn off bundling/minification while debugging in WebForms)
If your page contains Razor syntax, the breakpoints won't work.
Instead add the debugger; statement into the script as a breakpoint.
Then again, the debugger statement had failed to work earlier this year. It only works at top level, means before the page is completely rendered. It will not work if I put the debugger statement into $(document).ready()
So my work around now is to put my javascript in a separate .js file without any Razor syntax.
The good old console.log works for me as nothing suggested as above answers are working at all. Anyway it is what it is amidst the frustration for VS, nothing new about that.
If your Javascript is in a Razor file it will not work.
I have been struggling with this for ages and getting by with console.log.
But just now I moved the js into an external file and bingo it works.
I am using latest VS 16.11.5 and Chrome in a .Net 5 project with Razor pages.

netbeans project doesn't start web server

I have 2 HTML5 projects.
One runs on http://localhost:8383 when I click on run.
The other runs on file:/// and (correctly) shows a "Cross origin request" error when loading a json file.
Both projects are relatively simple html+css+vanilla javascript projects.
I compared both projects carefully. Specifically, I compared the project properties. "Sources", "JavaScript" and "Run" appear to be identical. Both projects are set to "With Netbeans Connector", "Chrome", but I tested both with the embedded Webkit Browser as well.
Whatever I try, when I click on "Run", one projects starts as http://, as it should, the other insists to start as "file:///".
Does anyone have an idea where I should look?
EDIT:
Things I tried:
Triple-checking Run configuration settings
Restarting Netbeans
Starting one project first, then the other
Testing both projects with Chrome and the embedded Webkit browser
Thanks in advance.
I faced a similar issue and solved it. I created an HTML5 project using an Oracle JET template.
The issue is with the template which is being used while creating the project. Re-created the project by attaching a different template (older version of oracle jet library) and also created another without attaching any template and it works successfully.
It looks like some compatibility issue between netbeans and the attached template!
My solution was to create a new project and copy all source files over.
Now the play button calls the web service.

Breakpoints not hit in javascript files in Visual Studio

I am experiencing some weird behaviors when debugging my MVC Web Application. Some days I experience these issues, but other days everything works fine.
The breakpoints in my javascript files are not getting hit. I get the dreaded "The breakpoint will not currently be hit. No symbols have been loaded for this document." error.
The debugger will detach from the process without me clicking the Stop Debugging button.
I have tried everything I can think of including:
Refreshing the page in IE to force the browser to get the latest version of the javascript files.
Clean / Rebuild the application in Visual Studio
Close / Reopen Visual Studio
Delete all files from bin and obj folders and rebuild
Cleaned up all old sites from my IIS Express applicationhost.config file
Installed VS2013 Update 4
Deleted / Reinstalled VS2013
Removed / Added IE11
Installed VS2015. Same behavior as VS2013
Deleted all local project files and performed a "Get Latest" from TFS
I can manually attach the debugger to an iexplore process and then I'm able to debug that specific file, but it seems like there is a different iexplore instance for each javascript file. I end up having to guess which one to use for each javascript file. To top it off, the debugger keeps detaching in the middle of me trying to find the right process to attach to. It is nearly impossible, and definitely not feasible to try and debug this way.
Our solution is in TFS, we're using IS Express and the three other developers on our team have none of the problems I have. We all have the exact same hardware.
Another clue that might help is that we are using the OWIN functionality to connect to ACS for security. If I bypass authentication through OWIN / ACS I can step into the javascript. This, however, creates other problems since the code is expecting me to be authenticated. This is not an acceptable workaround and, again, the other developers on the team are using OWIN/ACS and do not have any problems.
I'm extremely frustrated and at a loss for how to go about figuring our what is wrong with my environment. Any help will be greatly appreciated.

The JavaScript language service has encountered an error and has been shut down

Suddenly I receive this error message:
The JavaScript language service has encountered an error and has been shut down.
There is no intellisense in javascript!
What to do?
In my case I have:
Latest VS 2013 Upd.3
Latest Web Essential 2013
Latest ReSharper 8.2.1
Sometimes I see this errors on opening first JS-file after running the solution. I have spent about 2 days on it. Removing Web Essentials helps (also clean the AppData\Local\Microsoft\VisualStudio\12.0\Extensions folder:
extensions.en-US.cache
extensionSdks.en-US.cache
"WebEssentials" folder - it will contain file WebEssentials2013.pkgdef
Then I have tried reset all VS settings and it helped. For a month) Today I have updated solution from the GIT via VS Git Tools (commit contained a lot of JS and CSS changes) and have seen it AGAIN!!!
New solution steps:
Export VS settings.
Reset VS settings
Restart VS.
Check if now it has no any errors.
Import all VS settings EXCEPT Options => TextEditor.
Turn on line numbers for all languages (and if you have some other custom settings - them too)
I don't know who is to blame but I have the fresh Windows 8.1 + fresh VS 2013.
The newest solution steps:
Open the CurrentSettings.vssettings file.
Remove
C:\Users\USERNAME\JsDocComments.js|C:\Users\USERNAME\Modern.Intellisense.js
string from the file
The latest solution steps:
Since I have the laptop with the new clean system w\o this issue I have done the following:
Backed up the PC level ReSharper settings and reset all of them
Reset VS settings with export current one
Restored the PC level ReSharpe settings
Restored the VS exported settings except Options => TextEditor => JS and JS Specific
I have restarted the VS several times and don't see the error now.
Try this solution:
"I was able to fix it: Uninstalling Snippet Designer and deleting the Code Snippets folder on C:\Users\USER\Documents\Visual Studio 2012"
Taken from:
http://social.msdn.microsoft.com/Forums/windowsapps/en-US/d62506a1-4f5f-4013-bcaa-0f827325e424/javascript-language-service-has-encountered-an-error-and-has-been-shut-down
I got this after accidentally copy-pasting a large chunk of HTML into a JavaScript file. Removing said HTML & restarting VS resolved the problem.
In my case, I have Visual Studio 2013 and a Node.js project which is weirdly set up. I just created an empty one and then copied angular-seed into it. So things are not as expected by VS, I guess. I was getting the same error as in the question.
I did not want to uninstal the snippet designer, so I did two things:
I made sure all the snippets in JavaScript folder had shortcuts defined (manually modified xml files) (it was mentioned on the same page Andrea provided link for) - this alone did not help.
I noticed that JavaScript Language Service output widow had a message in it complaining about missing _references.js file. I added the file manually and added only one line to it:
/// <autosync enabled="false" />
Visual Studio stopped complaining about the service failing then. I don't know if fix 2 alone does solve the issue.
ps: I decided to add this info here because this question comes first on Google search for the error. I know it is an old one...
I encountered this issue when I opened a solitary html file.
My workaround is to first open a Solution that contains a web project and then to open a JS file within it. After this, my solitary html file opens without error.
Remove Developer Assistant extension. Work for me

Categories

Resources