Default MVC5 Application will not run out of debug mode in browser VS Express 2013 - visual-studio-2012

I have just started to develop an application in Visual Studio 2013 using MVC5. I am using the default MVC application, I have made no changes. I find that running the application works fine while in debug mode however if I Stop Debugging Shift F5 and change from on page to another or refresh my application in the browser I find that the connection to the localhost server is disconnected. I get a message Firefox can't establish a connection to the server at localhost: I have tested another application developed in Visual Studio 2012 and now running on VS2013 and it runs as expected out of debug mode. Has anybody else come across this problem. What am I doing incorrectly?

Do you have Edit and Continue enabled? (This can be found under your projects Properties -> Web, at the bottom.
When you have Edit and Continue enabled, the VS debugger attaches invasively to the web server process (IIS Express). When you stop the debugger, this kills the IIS Express process as well. If E&C is turned off, the debugger does not use an invasive attach, which lets the debugger stop without killing the attached process.

Related

Blazor Server - JIT Debugger on Windows Server 2019 keeps the app unresponsive

Good Day Everyone
I have post a question about this 7 months ago but it seems no one knows the answer for the question that's why I'm posting this question again, but the difference is, this is for Windows Server 2019
Here the link of my old post
Blazor Server - Slow load or unresponsive but still loading on browser (deployed to Windows Server 2016. IIS8)
We published our Blazor Server side application to our local server which is (now) Windows Server 2019, now the site becomes unresponsive when it encounters an error on the system, a JIT Debugger shows up on the server, that cause the sites unresponsiveness and also if we are updating the websites IIS, IT cannot delete or overwrite the files inside the folder because the JIT Debugger shows ups again. We disabled the JIT Debugger on the Visual Studio 2019 that is installed on the server, but still, the JIT Debugger still shows on the server, is there a way for the JIT Debugger not to show up on the server and makes the application working?
I hope someone can help me on this.
Thanks and regards.

Visual Studio Extension to attach debugger to remote process running in .NET Core on Linux

I'm using Visual Studio 2019 to develop a .NET Core 3 application which runs on embedded Linux. I am able to build the code in Visual Studio 2019. If I copy the binaries manually to the Linux machine and then start the application running there then I am able to attach the Visual Studio debugger to the remote process over SSH in Linux and debug the application. This does work, but it's tedious to deploy it, start it and attach the debugger manually for each debug session. I do have a script in Visual Studio Code which works, but I want to use Visual Studio Professional.
I'm trying to write a Visual Studio Extension so that I can press a key in Visual Studio to have the application built, deployed, started and then connected to the debugger. I would then share the extension with my team. It's very nearly working, except for attaching the debugger.
In the extension I am able to list the processes running in the Linux machine and select my application using this code:
EnvDTE100.Debugger5 debugger = (EnvDTE100.Debugger5)dte.Debugger;
EnvDTE80.Transport transport = debugger.Transports.Item("SSH");
EnvDTE80.Engine engine = transport.Engines.Item("Managed (.NET Core for Unix)");
EnvDTE80.Process2 process = (EnvDTE80.Process2)debugger.GetProcesses(transport, "192.168.11.1").Item("app");
process.Attach2(debugger);
There are two problems:
The call to GetProcesses() opens a dialog where I need to enter the Linux username and press enter, how can I specify the username in code to avoid the dialog appearing?
Even though the selected process looks like the right one (process.ProcessID matches what I see in Linux if I run the ps command), I get an exception when I call Attach2(). The exception message is "Exception from HRESULT: 0x8971001E"
I feel like I'm really close to getting this to work, any suggestions for how to finish it?
I also solved the second problem by changing the parameter passed to Attach2() from debugger to engine, as shown below:
EnvDTE100.Debugger5 debugger = (EnvDTE100.Debugger5)dte.Debugger;
EnvDTE80.Transport transport = debugger.Transports.Item("SSH");
EnvDTE80.Engine engine = transport.Engines.Item("Managed (.NET Core for Unix)");
EnvDTE80.Process2 process = (EnvDTE80.Process2)debugger.GetProcesses(transport, "root#192.168.11.1").Item("app");
process.Attach2(engine);
I found out how to add the user Name, but not the Password:
In GetProcess(), set transportQualifier to $"{userName}#{hostName}".
The 1st time the Window will still Pop up and ask for the Password.
But after that VisualStudio has stored the connection including the password.

Azure Remote Debugging - Network connection has been lost

I have an ASP.NET MVC 5 web application/API that I am running on Azure.
I am trying to remotely debug my application by attaching a debugger in Visual Studio 2017:
However, almost immediately this error pops up and debugging is aborted:
Sometimes it hits one of my breakpoints but then immediately stops. I have tried restarting my app a number of times but this didn't seem to help.
Any ideas?

Debugging in WebStorm for node.js

I recently joined the team which uses the node.js for the development. I am new to the whole node.js ride. I have used IntelliJ based IDEs in the past to configure to run and debug different programming languages. However lack of my understanding of node.js or for some other reason I cannot debug node.js application currently I am working on.
Using node v0.10.48, npm 2.15.1
I can run the application using the WebStorm IDE, but when I run the application, following is what I get in the console tab of debug panel. It also returns a > prompt in the console.
/usr/bin/node --debug-brk=44917 --expose_debug_as=v8debug <path_to_startup_js_file?
debugger listening on port 44917
debugger listening on port 44918
It stops for the break points that I put in the beginning of the file, but after starting the server nothing happens. Now I can't open client UI application, which makes calls to this node.js/express REST service. Even though it is up and running, I think.
By the way I know how to debug using node-inspector & browser. But not sure what am I doing wrong with IDE. The run profile works fine, but the same profile is not working for debug.
It turned out that application I was working on was spawning child process, which has to be debugged separately as a remote debugger. Webstorm was nice enough to support debugging both master and child thread at the same time, via two separate debugger.
The current node version used by the project is also relatively old. Which was also the part of the issue with the webstorm. It was verified by the jetbrain support team member.

Start IIS Express without debugger

For performance reasons I'd like to start the IIS Express Webserver without debugging. Settings the 'compilation debug="false"' parameter in the web.config solves the issue but every time I start debugging my application, Visual Studio displays an error, saying that the debugger could not be attached. If I disable the Web Project's "Always start in debug" I won't get this error but, of course, IIS Express won't start.

Resources