When I run my service fabric service in visual studio it deploys to the service fabric as expected. When I stop debugging in visual studio, visual studio then unprovisions the service fabric service.
Is there any way to prevent this behaviour? I would prefer it if visual studio left the service running in service fabric.
Thanks,
Slicc
There are two ways this can be done:
Launch your app from VS without the debugger attached (Debug -> Start Without Debugging [Ctrl+F5]). Obviously, this would require you to manually attach VS to your service processes in order to debug them. When you detach VS from the processes, VS will not remove the application in this scenario.
With your Application (.sfproj) project selected in Solution Explorer, go to the Properties window and change Application Debug Mode from "Remove" to "Auto Upgrade". This prevents VS from removing the application after debugging. However, it also causes another change in behavior in that it will automatically upgrade your application each time you launch it from VS. The added benefit of auto upgrade is that your application state will be maintained across multiple launches from VS. This may be desired or not. There is not a setting that allows you to both prevent application removal and not do an auto upgrade.
Related
we currently have 2 developers working on 2 different websites, on the same server.
when an error occurs in one of the web applications, that debug option pops up for the wrong developer. how do we specify what VS instance is to be used for which w3wp debugger process attached?
Here are a couple of options sorted from best to worst...
Run Visual Studio locally on the developer's computers so this isn't a problem.
On the server, use Visual Studio's web server instead of IIS. This gives each user an automatically created local process that can be debugged.
If you must use IIS, configure each application in IIS so that they run in their own application pools. Each application pool gets its own w3wp process so your Visual Studio instances can attach to their own process.
I cannot get Visual Studio 2015 to attach remotely to my Azure site. Or, rather, it attaches okay, but no breakpoints are ever hit.
I've confirmed I'm publishing a debug build. I tweaked web.config to require that.
I've confirmed remote debugging support for 2015 is activated within the Azure portal.
The site launches fine after the attachment...just no breakpoints.
This is an MVC6 site using rc1.
For the sake of other people struggling with this, it turns out VS2015, even with all the latest updates, isn't "aware" of dnx running under Azure. So it attaches to the wrong process on the Azure site.
After doing "Attach Debugger" within Cloud Explorer or Server Explorer, you must go into Debug -> Attach to Process, and do two things:
change the qualifier so it points at the remote Azure site
manually attach to the dnx.exe process
The first step seems to get "remembered" by VS 2015. The second step most definitely does not; you have to do it every time you do a remote debug attachment.
Also, you need to refresh the site in your browser after doing all of this for the debug cycle to start.
Here's a link that explains this a bit more: https://blogs.msdn.microsoft.com/webdev/2016/03/21/remote-debug-aspnet-core-on-azure/
Try downloading cloud explorer here
attach debugger as below
Enable debugging setting in azure portal with visual studio version as below
Attach remote debugger to w3wp as below
5 Make sure Debug must be = true
Make sure you deploy application to azure in debug mode
Why the heck does visual studio (2012 I'm using, I think previous versions did this too) load the WebDevServer for all web projects in my solution when I tell my solution to attach to another process?
If I'm attaching, obviously I don't want it to load processes because I'm debugging an already running process! Gah!
Anyone know how to make it not do this when I'm attaching to another process? This is driving me nuts because the web dev servers load up and try to acquire resources in use by the already running processes I'm trying to attach to..
I have found this occurs on some projects. If you change the project properties > Web > Servers. And the choose "Use Custom Web Server" that will ensure that Visual Studio does nothing when you attach.
In Visual Studio 2010,
I want to debug two web applications running on IIS at the same time.
When debugging the first application it is ok. But when starting to debug the second application and first program is still in debug mode, Visual Studio prompts:
unable to start debugging on the web server. a debugger is already
attached
How can I solve this problem?
To summarize, one has to set different application pools in IIS for the two applications to debug.
Here is a rough instruction, given that both applications have been deployed to IIS once within Visual Studio.
Open the Internet Information Services (IIS) Manager
Click Application Pools on the left pane
On the right pane add another integrated application pool, let's name it Second ASP.NET 4.0 Integrated
For one application, open the Advanced Settings...
In the properties view finally select Second ASP.NET 4.0 Integrated as the application pool
This way the applications should be debuggable in parallel because each Application Pool spawns a new operating system process to which a separate debugger can be attached.
A windows process can only have one debugger attached to it at a given time. If you get that message it means that you're attempting to debug the same process twice which won't work. But that also means you should be able to debug both web applications in the instance of Visual Studio that's already attached. It may require a few extra steps though to get it to acknowledge the other code
Disable "Just My Code" (Tools -> Options -> Debugger, uncheck "Enable Just My Code"
You may need to manually load symbols for the other web application through the modules window (Debugger -> Windows -> Modules)
After that though (second step may not be necessary) you should be able to set break points in both web applications and otherwise debug them.
I'm using Visual Studio 2008 to develop ASP.NET applications. Currently I'm debugging with running on IIS. I would like to switch to the development web server (Cassini) for debugging, so that I can use features like edit and continue. The reason that I'm not, is because the development web server only starts up when you are in debug mode. Is there any way to keep it running all the time, and just have Visual Studio attach to the existing server process like it does with IIS?
Rihan is partially correct...
In your Project Property page, Web tab: Enable Edit and Continue
If checked - The Development server will close when the app (not VS) stops.
If unchecked - Development server keeps running
You can also start your cassini server from the command line which takes alot of pain out of the whole "debug" effort...
Check out a good snippet here on how to do this: https://thoughtjelly.wordpress.com/2009/05/13/launch-cassini-from-the-command-line/
Once started, the built-in web server continues executing even when you stop debugging, as long as your VS2008 project is still open. Just start up the debugger when you want to start debugging again. I typically have another browser window open and interact with the built-in web server from there instead of the browser window that it opens so I can keep working with the application in the same state even after turning off the debugger (which closes the opened browser window).
I'm running VS2008 on Windows XP SP3.
The simplest way I have found to acheive that is by launching the debugger as normal. Then in Visual Studio goto the Debug menu, and select detach all. It detaches from the Cassini web engine, but it does not shut it down, as it does when stopping debugging.
I am quite sure you are know that there is command line swithces that you can you use to launch the cassini engine, but my guess is you are looking for something slightly easier.
Detaching does not close the browser window that visual studio launched, and if you do close that spesific web window then it will stop debugging.
I am running VS 2008 SP1 on Vista 64x SP1 without IIS.
Hope it helps
Rihan Meij
I have 3 web sites, with Single sign on between each site so I need to start all 3 with attach to process. However, there was no process to attach the debugger to, and whenever I started a project with F5 then stop it, the visual studio web server closed.
The Enable Edit and Continue option didn't change anything.
So to start the web server and keep it running so that you can attach the web project to the process, I simply did a "view in Browser" (ctrl+shift+W). This started the server process but not the project nor the debugger. I could then attach to process easily.
In Visual Studio 2015 you do this by going to Tools > Options > Debugging > General and unchecking the "Enable Edit and Continue" option: