How to debug Silverlight application with multiple browser tabs? - visual-studio

I have made a Silverlight application that can be started with deep links. My problem is that I need to debug when I try to open the application in another tab with a deep link.
I use VS 2010.
Thanks.

If the piece of code you trying to debug executes immediately upon opening the tab you could try to defer the execution by adding a delay that would allow you to use Visual Studio's Debug -> Attach to process functionality.

Related

VS2011 - cannot debug javascript Metro style app

I have Windows 8 Consumer Preview and VS2011 Ultimate, not Express. All I want to do is stop at a breakpoint in the default.js script file. I created a project from the Split layout template and just ran it. My javascript debugger console says:
Visual Studio is not currently attached to a script debug target that
supports browser diagnostics.
I am in debug mode, with Script only debugging configuration. I cannot get any project, including the samples from MSDN to JS debug. Has anyone else had this issue?
The lifecycle of any Metro APP is controlled by the PLM. Whenever a metro app is waiting for a user action the PLM suspends it after a certain timeout. So normal debugging tools may not be useful with the PLM controlling the life cycle of the app. Check this for a detailed description

How to debug two web applications/services on IIS from within Visual Studio?

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.

Visual Studio: How can I start the development server WITHOUT opening a browser window or seeing a warning?

Visual Studio 2010 Professional
So I want to be able to "Start Debugging (F5)" or "Start Without Debugging (Ctrl + F5)" without a) Opening a browser window or b) Getting an error message from Visual Studio
I tried the following:
Setting "Start Action" to "Don't open a page. Wait for a request from an external application"
This works great for debugging, however if I start without debugging I get this error message every time:
Setting "Start Action" to an external program that doesn't do anything. This works great for starting without debugging, however if I try and debug then the debugger starts and stops immediately.
I don't even understand that VS error message. I'm "Starting Without Debugging"... of course there's nothing to debug! Stop bothering me!
Thanks in advance!
I can provide a workflow that only opens a browser window when you first start a development session. I know you don't want to open a browser window ever. If this is a workflow preference, then I have found the solution below good-enough for myself.
I keep the start action as 'Current Page'. When starting a development session, I use 'Start Without Debugging' to start the ASP.NET Development Server, and a web browser. I close the web browser, but the Development Server remains running and continues to server requests for your application.
If the debugger is not attached, and I make a code change, the I use 'Build Solution (F6)' to rebuild, and the Development Server uses the newly built binaries. Changes to views are automatically detected and re-compiled.
To debug, I use Debug -> Attach to Process (CTRL + ALT + P for me) and find the correct running WebDev.WebServer40.EXE process based on the port.
The Development Server remains running as long as the solution remains open in Visual Studio.

VS 2008 Attach to process disabled

I have used the attach to process feature of visual studio a number of times. However now when i try to attach to a process (dll) the Attach button is disabled. However if i select any other process except the managed one the Attach button is enabled! My problem is closely related to the problem described at the link below
VS attaching to process disabled
A picture of the dialog is attached.
This is almost certainly because there is already another debugger attached to the process - probably the currently running instance of Visual Studio but it may be another instance of Visual Studio, or another debugger entirely (such as WinDbg or a remote debugging session).
Check the "Processes" window (usually found under Debug -> Windows -> Processes) to see what processes Visual Studio is debugging.
Found the solution to the problem
How to step into C/C++ DLL from C# application while debugging
http://msdn.microsoft.com/en-us/library/605a12zt%28v=VS.90%29.aspx

Can I Attach to Process without it being already running?

Using Visual Studio 2005's Attach to Process, is it possible to select an application to run and then debug as opposed to an application that is already running?
I am trying to debug a FileMaker Plugin and I can debug it fine if I open FileMaker then use attach to process, but I now want to debug the initialisation of the plugin so need to debug as soon as the host application starts.
Is this possible?
using F5. Drag and drop the exe file to Studio and then start Debug. You can launch the exe from Visual Studio itself and provide the dll names in "additional dlls"
For a VS project you can easily specify the command to be executed in the Debug section of the project properties. You have not specified what language you're using but AFAIK you can specify the debug command in all of them.
For C++ this is located in the Debugging section, the property is Command.
For C# under the Debug Tab, specify the external application to start.
Absolutely. I've had success with the method posted here and the Windows Debugging Tools.
You can also launch the process from your code and use Debugger.Attach to launch the debugger dynamically.
There is also a Visual Studio plugin that will handle this for you.

Resources