Debugging with ASP.NET MVC 3 - visual-studio-2010

I'm working on an existing ASP.NET MVC 3 project on Visual Studio 2010. I'm not very familiar with the technology. I've done a lot of work with ASP.NET Web Forms though. I'm trying to debug something and for some reason, my breakpoints aren't being hit. I know that the code that I'm attempting to debug is being ran. But I don't know why I can't debug.
When I attempt to start debugging, I've noticed that the little round red circles that represent breakpoints stay solid. If I remember correctly, they should change to an empty circle with a red outline to show that the breakpoints are yet to be reached.
What am I missing?

Related

Document outline controls disabled in Visual Studio 2019 for .Net Core

Now that .net core support WinForms projects, I've ported an old project to .Net 5. I can edit code, desing GUI and compile, and everything seems to work fine except for Document Outline window (in Visual Studio 2019). All four buttons, move up, down, out and into, are disabled, so I cannot choose what to see on top at desing time.
I have created a new project from the scratch and those controls are still disabled.
Demo image:
Any idea why? I can guess it's something microsoft is working on, but I cannot find any reference to this issue.
That's how it looks like for .Net 4.5

Unable to see WPF Controls Inside the Solution Explorer

I am working with 10 other people on a VS, C# , Xaml project but recently a branch someone pushed to the master broke the Solution Explorer and I am not able to get it to show the elements under MainWindow.xaml.cs again
No one cares too much about this because the controls are still working if we call them by code and our designers use Blend to edit the design (note: all the controls appear fine in Microsoft Blend for Visual Studio)
But it is troublesome for me to have to open Blend just to adjust a minor design flaw instead of doing it inside Visual Studio directly.
I tried googling but haven't found anything related to my issue yet.
Working Image Example
Broken Image Example

Asp.net MVC View slow preformance issue

I am having some trouble when I am trying to some razor and html code inside my MVC Views. Visual studio keeps hanging and not responding. When entering a simple tag it can take a few mins to appear. It seems to be a performance issue with asp.net views.
The problem only occurs when inside the views. when coding in the model and the controller I don't have any of the issues.
I am using Visual Studio 2010. Even at home on a better spec machine I have the same issue only the view run really slow.
Has anyone else noticed any performance issues when trying to develop a asp.net MVC 4 view?
Is there any fixes out there for this.

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...?

Design-time debugging in Visual Studio 2010

I have the following problem with design-time debugging in Visual Studio 2010 Pro.
In my solution I have got two libraries. One with name Alfa that contains some of my basic components. Two with name AlfaDesign that it contains designers for components from library Alfa. And of course I have a project for developing and testing Alfa components.
AlfaDesign is having reference to Alfa library. And the test project is having a reference to Alfa and AlfaDesign.
And my problem:
When I put breakpoint in component's constructor from the Alfa library and then I put this component on the form in my testing project, the debbuger is doesn't break. Visual Studio is still running.
I followed instruction from the tutorial Walkthrough: Debugging Custom Windows Forms Controls at Design Time, but without any success.
I ran into this problem today with one of my projects, and I spent the last several hours figuring it out. What I found is that the symbols and modules will not load when your project target framework is set to anything less than .NET 4 when doing an F5 debug. Switching the projects to .NET 4 does fix this weird behavior, but you may not want this for .NET 2 applications that you don't want to use the newer runtimes/BCL.
However, you can still correct this behavior. You can run manually use Debug -> Attach To Process and select devenv.exe and that will load the modules and symbols. So, you can either have a second instance of Visual Studio 2010 already open and simply attach, or you can run it on debug (Run External Program), Detach, and Re-attach to get the modules to load.
I thought this was something wrong with my environment settings, because my install of Visual Studio is very customized, so I thought there might have been some sort of setting, conflict, or file difference, but it seems to just be a weird behavior in the Visual Studio 2010 debugger. I would be curious to see if anyone from the Visual Studio 2010 team could investigate this a bit further.
If the breakpoints are properly resolved, then it must hit properly.
Please check the following.
Is the breakpoint resolved properly or not. If it's properly resolved, it will be displayed in red during debugging sessions. Otherwise the red will turn into a disabled state (with a yellow exclamation mark with a grayed circle).
Why don't you put a breakpoint where the object is being constructed and debug through it? So that you can ensure that your construction code is working well. You can step through (F11) to get inside the constructor.

Resources