Question on debugging a Silverlight app in VS2008 - visual-studio

Im trying to debug my first Silverligt 3 app. I have it linked to a web project. The problem is that if an exception occurs, I get a popup that tells me to choose a debugger, and after doing so says something like "There is already a debugger attached". Im used to WinForms where, if an exception is thrown VS breaks at that point and shows me where it is thrown. Is this type of behavior possible with Silverlight?

Yes, you should be able to debug your silverlight apps in exactly the same fashion as with winforms. Are your debugging settings correct? You should have your web application set as the startup project and make sure that silverlight debugging is enabled for the silverlight project, and asp.net debugging is enabled for the web app. Also make sure you are not building in release mode.

Related

Unable to remote debug a ASP.NET 5 WebApp in Azure

I created a new ASP.NET 5 RC1 WebApp using Visual Studio 2015 and published it to Azure. I turned on remote debugging and selected VS 2015 for the debugger. I can attach to the WebApp, but any breakpoint I set is not showing up completely red. Hovering over the breakpoint gives you the message "The breakpoint will not be currently hit. No symbols have been loaded for this document." I did a bunch of searches to see if anyone else had encountered this issue. I found some articles that seemed to indicate the solution:
Remote debugging Azure website: Breakpoints not hit
Azure Website Remote Debugging with git deploy not working
I tried turning off "Just my code" and adding the app setting, but neither of these worked. I even had a colleague try the same thing from his system and his Azure account to make sure it wasn't just an environmental issue on my system. Does anyone know how to fix this?
The problem is the VS 2015 Azure tooling is not yet DNX aware at the debugger level. So for now, you'll need to manually attach the debugger, using the steps documented in this article.
Once you get the list of processes, you'll want to attach to the dnx.exe process, instead of the usual w3wp.
I just tried with a new ASP.NET RC1 app, and was able to set and hit breakpoints. It took a while to attach and load symbols, so be patient :)

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

Debugging a Silverlight project with a WCF service

I have a WCF service hosted in IIS which is consumed by a Silverlight client application. When I run the Silverlight application, none of the break points seem to get hit (not breakpoints in the service, although they also don't get hit. That service is not in the same solution).
Normally when I've created SL projects in the past, they hit break points by default, and I can't thing I've changed any of the settings.
When I run the project, I do get a message box saying, "The Silverlight project you are about to debug uses web services. Calls to the web service will fail unless the Silverlight project is hosted in and launched from the same web project as the web services. Do you want to debug anyway?"
So I say 'yes'.
My break point is in a place that I know gets hit (InitializeComponent in MainPage.xaml.cs), so that's not it.
I don't know if it makes a difference to the client application, but the WCF service does have within its App.config the compilation debug set to 'true'.
Can anyone help?
Edit:
Some useful points: The project is set to debug. There is no web component to the SL project. The application compiles and runs normally. The code in the screen shot below is the code behind for the main page which is the default page (and the one I see when I start the project). The Visual Studio version is 2010 Ultimate (version 10.0.40219.1 SPRel) and I am not creating an OOB application. As well as just running regularly, I have specifically started from the Debug->Start Debugging option in Visual Studio.
Screen shot:
If that image isn't clear enough, there is the full resolution one here.
Second screen shot showing a break point on the InitializeComponent in MainPage.xaml.cs which doesn't fire (the previous one showed the constructor of the related view model).
Again, if that's not clear enough, the full resolution version is here.
The message your getting is unrelated to your breakpoints not being hit. This 'warning' isn't entirely true as well, as long a the webservice you're calling is running you'll be fine. You can happily ignore this warning.
As to not hitting breakpoints, I can think of two reasons. You could be building in release mode, or you could be starting the wrong project. You should not be starting the MyApp.Web project Visual Studio probably created for you, but the actual Silverlight project.
If it isn't one of those options you should provide a bit more detail about what you're doing, like Visual Studio versions, whether you're running an out-of-browser app, does the app actually work etc. There can be a few more things to check but it hard to guess it them with this little info.
I'm not seeing a test page.htm in your solution. How are you hosting / running the SL app?
If you were hosting it in an ASP.NET web app I'd say check that the Silverlight debugger was enabled on the web project project properties.
But as it is I can't see how the silverlight app is getting run at all...?

Visual Studio 2010 won't allow me to debug web application

I have the .NET Target framework set to .NET Framework 3.5
When I try to debug with f5, i get the following message in a popup window:
"Unable to start debugging on the web server. Mixed-mode debugging of x64 processes is not supported when using Microsoft.NET Framework versions earlier than 4.0."
Of course when I set the target framework to .NET 4.0 it works fine. However my web server only supports up to 3.5 so I have to try and make this work with 3.5.
The closest match to a googled solution is found here:
http://msdn.microsoft.com/en-us/library/dd409790.aspx
however when I try to follow the steps to change the platform to x86, the setting it tells me to change simply isn't there. The closest thing is project properties -> Build -> Platform target, and that doesn't fix the problem.
What am I doing wrong?
THANK YOU FOR YOUR TIME
What you need to do is disable mix-mode debugging. That is simultaneously debugging native and managed code. That is what's causing the issue here.
Right click on the startup project and select properties
Go to the Debug tab
Uncheck the box which says "Enabled unmanaged code debugging"

Windows 7 Gadget debugging with Visual Studio 2010

i try to debug a windows gadget. Just-In-Time debugging fires up and i can see an VS2010IDE attached to the sidebar process. But there is no source code to debug! Only a blank file with the yellow debug pointer. What is my problem?
Configuration of my system is based on this article:
Gadgets for Windows Sidebar Debugging (http://msdn.microsoft.com/en-us/library/bb456467(VS.85).aspx)
We have posted on the MSDN forum about this.
I think script debugging is broken in studio 2010 beta2.
I cannot get script debugging to work on my ASP.NET MVC project either.
We get a blank page, and the IDE cannot find the code to debug.
Trying to open files in the Internet Explorer tree in solution exlorer results in blank files being opened.
I think it's a bug - and afterall it is a beta.
I also had this problem, and for a while I was thinking it might have to do with my machine being 64-bit, or a permissions issue, but I have no way of confirming it.
However, I was able to solve it by using the template on this Code Project site:
http://www.codeproject.com/KB/gadgets/HeterodoxGadgetTemplate.aspx
The nice thing about the template is that it's setup as a Windows application. When you run the app it handles the local deployment of your gadget and starts the sidebar service (sidebar.exe). I believe this probably gets around a number of permissions issues.
After setting up a new project using this template, I was able to successfully debug the JavaScript using the "debugger" methods explained everywhere else (for example: http://msdn.microsoft.com/en-us/library/bb456467%28v=vs.85%29.aspx).

Resources