VS 2012 Breakpoint Issues - visual-studio-2012

I have run into an issue with VS 2012 not hitting breakpoints during the seeding process of my DB. I am on Svr 2008 R2 using EF 5. This is similar to this breakpoint issue, but not quite the same. Once I get past the seeding process my breakpoints work fine in the controllers (and I assume everywhere else).
I can get the breakpoints to work with IIS Express, but not IIS 7. Since the breakpoints that I would like to hit are in the Application_Start and the Seed process I do not have time to Ctrl-Alt-P to attach a process and attempt debugging that way. I did check windows authentication and registration of iis, those did not affect the breakpoints.
I can verify that the seeding is run with logging and how the DB is created. I would prefer not to revert to the dark ages of debugging with logs though. I would also prefer not to be required to switch back and forth between IIS Express and IIS 7.
To recreate this I started a new VS 2012 proj selected MVC4 and Internet Application. I manually changed the web.config to point to SQLEXPRESS. Then I changed the project properties > web to not use IIS Express. I created a breakpoint in the Application_Start and and a breakpoint in the homecontroller/index and ran the project. The only breakpoint that was hit was the index breakpoint. Rechecking the IIS Express allows both breakpoints to be hit.
Please let me know if you have seen this issue and have a workaround.
Thanks,
TJ

I seem to be running into lots of these types of issues lately. I clear ways to replicate them, and I leave them alone for a few days and they disappear. I am unable to recreate this anymore. I even used the same project that I was only changing the checkbox to use IIS Express.
So, when in doubt, don't pull out your hair, work on something else and be patient. Who knows, perhaps turning it off and on again worked (even though I did try that, thanks Roy).

Related

The DefaultHttpHandler.BeginProcessRequest method is not supported by IIS integrated pipeline mode

We are having issues in hosting Webforms apps in one of the windows 2012 servers and IIS8.5. The server causes "DefaultHttpHandler.BeginProcessRequest method is not supported by IIS integrated pipeline mode" exception.
Attaching a screen shot for your reference
However when I tested in another server it works all fine. To isolate issues I have even tried to deploy a sample webforms app and try out.
I need integrated mode pipe line as I have a requirement around it.
I have verified the servers and there is no difference in iis configurations. What could be the possible reasons for this? Any guidance to narrow down the issue will really help.
Attaching the server comparison report. The image shows the differences in two servers. in the right side server the application does not work and in the left side server it works. If you see the diff there is not a lot of changes and btw the changes are because I added them as part of trouble shooting.
We compared every possible stuff on the servers and finally decided to take up the server in which it is working. The server in which it didnot work might have some issues with they way IIS was deployed.
So in a way there was no way out for this problem for me.

IIS Server Express Fails on DB

I have a strange issue which is getting worse as I add more code to my site.... Sometimes after I edit code IIS express will refuse to function correctly. I.E. my login function takes way longer than usual and I'm not logged in. Any calls to DB for that matter fail. I've been shutting down Visual Studio and restarting, this seems to fix the issue in most cases, but is there a better way? I've tried stopping debugging and rebuilding the site but that doesn't seem to help.
I've just added some Console.WriteLine statements to the catch on the db call which pulls user data from the DB on login but I'm not getting anything there. How do I get IIS Express to update what it's running without restarting visual studio?
This issue was caused by mis-configuration of ISS EXPRESS. Installation and re-installation did not fix the problem, but deleting the ISS EXPRESS directory from my user's profile did.
I had over 50 sites configured throughout my classes in UNI which I believe were causing the problem.

Visual Studio 2012: MVC, Umbraco site extremely slow while debugging

Windows 8.1 Pro, Visual Studio 2012 Update 4, MVC4 Umbraco site using SQL Azure (have also tried with a local SQL 2008 R2 db). Running through IIS.
Site runs perfectly while not debugging. However, when debugging the site is extremely slow. The default page takes nearly a minute and a half to execute. Subsequent requests take the same amount of time.
I thought this may be environmental (Surface Pro 3, i5), so went over to a MacBook Pro (i7)...issue still occurs on that PC as well.
At my wits end trying to figure out what could be causing it.
Thank you so much!
There are several thing that could be happening here. Using an Azure SQL db would cause slower initial loading of pages (compared to a local db) because of the data transfer time. However, subsequent page loads should be quick because everything would be loaded into the site cache.
If subsequent page loads are still extremely slow then this could be because the XML cache isn't being generated. Check that the settings are correct in the web.config in debug configuration.
Also, check where you are writing your debug logging to. Umbraco will write log messages to a log file in App_Data/Logs/ and also separate logs to the database. Using a remote database would make these writes slower.
Without knowing what else is happening in your project it's difficult to know what other factors may be playing a part. But you need to step through the application in debug mode in VS and you can check the event viewer for swallowed errors like timeouts. Finally, you can use a profiler to pin point exactly where your issue is.

Remote Debugging Azure Worker Role

There are a million links like this one http://blogs.msdn.com/b/cie/archive/2014/01/24/windows-azure-remote-debugging.aspx, which more or less would seem to take care of the remote debugging setup. I have done this many times in VS 2013 Update 2, deployed, then attached to debugger and it simply does not work. Well, the debugger seems to attach, but I continually get the message when I hover over a break point informing me that 'The breakpoint will currently not be hit. No symbols have been loaded for this document' A while back I recall seeing a channel 9 presentation and they seemed to configre the symbol store. I tried configuring this and it still gives me the same message when hovering over the breakpoint.
VS 2013 Update 2 Remote Debugging - I can only get it to work with a 'Debug' build. I have set the Debugging Option "Enable Just My Code" and loaded all symbols -- this seems to work fine. I can now set breakpoints and do not receive the message you (and I) noted earlier.
This is probably not the ideal situation as it would be nice to be able to attach the debugger to a production release but it seems to be a semi-reasonable workaround for now.
EDIT:
Important points:
You must enable Remote Debugging in the Azure Portal for your Cloud Service or Web Site -- Configure Tab (it only remains enabled for 48 Hours)
The debug attribute of the compilation element in your Web.config file must be set to "true". This means, you either have to do a 'Debug' build or manually edit the Web.config file. Here is a link to official Microsoft documentation with a full explanation and a great example of how to do that without redeploying your application:
http://azure.microsoft.com/en-us/documentation/articles/web-sites-dotnet-troubleshoot-visual-studio/#remotedebug
If you still have problems you may have to disable the Debugging Option Enable Just My Code in Visual Studio
I had the same problem - also with VS 2013 Update 2.
The crucial bit I missed was selecting the w3wp.exe process in the pop-up that shows the running processes before hitting the Attach button.

Azure Mobile Services on Local IIS rather than IIS Express

OK, I've created an Azure Mobile Services project in Visual Studio 2013.
I run it up as-is, then in the browser I test it by adding a todo item via the simple browser app that seems to get baked into these service projects. It gives me a '201 success' message - brilliant.
I then convert the project from IIS Express to Local IIS as the web host, recompile and try again, and although I get the same smiley face app telling me that everything is OK, when I try and add a todo item I get a 404 error. This is contrary to the Microsoft article that gives these instructions, which clearly says I am able to choose either IIS Express or Local IIS when setting up the project.
My guess is that web.config is missing something when this project runs on the local IIS server.
I'm hoping someone already has a solution before I spend hours trying to work out how to configure IIS for this type of project.
I've already wasted a load of time working through loads of bugs and gotchas with Azure Mobile, and I'm starting to run out of steam - so I'm hoping someone can help me before I go and grab an account at Parse.com
Many thanks in anticipation.
Dean
The easiest approach for your situation might be to just deploy to the cloud, and use that service for your testing. Visual Studio 2013 Update 2 makes it easy to deploy your app and connect to it for remote debugging. It is a little slower than using a local instance, but you are also assured that there will be no surprises when you eventually go live (since you are live the whole time).
That said, we will investigate the issue you are seeing with using IIS directly. Some things you might want to try on your own:
Verify that you can view the web side from your Mac's browser, to make sure that the firewall is letting the requests through.
Try using the "Getting Starting" link from the smiley-face page, to see if the REST endpoints are behaving correctly.

Resources