VS2015 error “Application is not currently attache

2020-08-01 04:59发布

I created JS & HTML5 Blank App with Visual Studio 2015. When running it in VS debugger in "Local Machine" mode, I get the following error message:

Application is not currently attached to a script debug target that supports script diagnostics

Just ignoring the error is not workable as at least breakpoints and console.log("text") do not work.

I'm having default options in VS. I am running normal Win10, with automatic updates on. Reinstallation of VS2015 did not solve the issue.

3条回答
淡お忘
2楼-- · 2020-08-01 05:20

In my case (VS 2017 not 2015), the option shown below had somehow become unticked (I'm blaming an update). Before ticking this I was getting the same error as the OP; after ticking it, all is well again.

NB I'm debugging the Javascript within a WebBrowser control hosted in a Winform.

enter image description here

查看更多
Lonely孤独者°
3楼-- · 2020-08-01 05:30

I finally got this solved with the help of Jack-Zhai in msdn forum. So, the summary of my journey:-

Problem: - Running JS UWP blank app in debug mode & local machine w default settings in VS2015 generates a warning "Application is not currently attached to a script debug target that supports script diagnostics" into JavaScript console. Breakpoints do not work, adding console.log("here") does not write anything to console

Solution trial 1: - changing and playing with VS2015 settings; the problem still exists

Solution trial 2: - reinstalling VS2015; the problem still exists

Solution trial 3: - reinstalling Windows10 - all applications deleted but user data not - installing VS2015 => Problem solved; debugging blank app works, and console.log("test") works

查看更多
霸刀☆藐视天下
4楼-- · 2020-08-01 05:32

This worked for me although I was doing something slightly different. I got the same error message using IE 11 accessing a HTML file from my local file system (was mucking around with HTML). Seems IE developer tools don't much like this mode of operation (why?!). Here's my story...

File on my local windows laptop:

c:\temp\test.html

Can be opened in these browsers:

URL: file:///C:/Temp/test.html (in chrome)
URL: C:\Temp\test.html (in IE 11)

In Chrome tools commands in the console can be run no problem e.g. console.log("hi");

In IE developer tools this fails with the message cited by the op.

I had a reverse proxy installed on my laptop (nginx) so tried serving the file up via HTTP and this fixed the issue with IE. Here's how I would access the file via HTTP via the proxy:

http://localhost:9092/temp/test.html

For reference here's my nginx.conf (but any other proxy would I expect work fine)...

worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    server {
        listen       9092;
        server_name  localhost;
        location /temp {
            alias "C:/temp/";
        }
    }
}
查看更多
登录 后发表回答