I have an application where I can start it out in debug mode, and everything will run fine for several minutes until it will randomly pop up a box saying "You are debugg in a Release build of ***. Using Just My Code with Release builds using compiler optimizations results in a degraded debugging experiance...
I am running multiple projects at a time (they all depend on each other)
The project that it is erroring on is a class library that is referenced by both console applications and Web Api applications and is housing my data layer.
I have checked in the configuration manager and everything under debug is set to debug.
When I mention random above, at times it will error when I am trying to use the application, while other times it will error when sitting idle.
I have attempted to do a repair on Visual Studio and am using Visual Studio 2015.
I have also had other errors such as IIS Express just quit working out of nowhere, and I am using a machine with very good performance.
Does anyone have a suggestion on what I can troubleshoot next? I just wouldn't think that it would be the code if the code is being executed before the error just fine.
I finally figured out the "fix", which is very strange. I went in and enabled Suppress JIT optimization and everything went to working. I then disabled it to ensure that was the issue, but it has continued to work. I am not sure how this fixed this issue, but all appears to be working now.
Also, I am running Update 3 as asked above.
Related
I have a 15 year old web forms app targeting .NET 4.6.1 that I'm maintaining, and I recently upgraded my laptop to VS 15.9.3. A release build of this app with 15.9.3 no longer fires the Application_Start event on production servers (running .NET 4.7.2). It runs locally just fine and I frequently deployed production builds from this laptop prior to the upgrade.
My desktop computer is still running VS 15.8, and a production build there works fine. The source code is the same between these machines, only the VS versions differ.
Symptoms and attempts at remedies:
I cleaned out all old files from production and tried setting it up from scratch. No dice.
Setup new application under IIS using the same build, but the outcome is the same.
Nothing in the event logs about any errors, except for the error that gets raised when some pages try to access state that's initialized in Application_Start.
I try to log some messages and even raise an exception right at the start of Application_Start, and I don't see anything, so Application_Start is definitely not running.
What can I do to further diagnose the problem? I haven't been able to find anything about this online, or why the newest VS release suddenly doesn't work.
Barring any remedies, any suggestions for downgrading VS instead of completely uninstalling and reinstalling the older VS?
Edit: now even reverting my laptop to VS 15.8.9 did not roll back the problem, so I've disassembled a build from both machines. There are few differences, basically the build number of a dependent assembly, the module version identifier, the comment designating the "image base":
Not working build:
// Image base: 0x055E0000
Working build:
// Image base: 0x052D0000
As far as I understand, none of these differences should have any observable effect. I then disassembled the dependent assembly that's built alongside the ASP.NET app, and it has the above differences and a few more related to the offsets for static field initializers. So I still have no idea why this might be happening.
Edit 2: it seems the issue is in the final aspnet_merge step while trying to merge the precompiled web forms. The merge fails in finding any assemblies to merge, suggesting that precompilation may have failed.
My current ASP.NET Web API project simply quit running a couple days ago. No code, not even the code in Global.asax.cs, is executing. Some clues:
The project stopped working after I hopped over to a subcontractor's Git branch. When I hopped back to the master branch, it didn't work.
The issue is associated with my primary development computer (Windows 10 running in a Parallels environment on OS X). It runs fine on my secondary development machine.
If I attempt to establish a breakpoint on any line of code after
starting debug, I get the following error: “The breakpoint will not
currently be hit. No symbols have been loaded for this document.” I
have followed every thread on the following stackoverflow
breakpoint not hit posting, but have been unable to get it to work.
In addition to implementing the the threads on the stackoverflow
breakpoint not hit posting, I've tried the following.
Verified that debug configuration and full debug info are set on all assemblies.
Manually deleted all bin and obj folders. Cleaned and rebuilt the
project.
Rebooted numerous times.
Maybe you have some files leftover from the subcontractor's branch that you don't want? Have you tried discarding all of your changes and then pulling on your good master branch?
Also, I usually find myself receiving the "no symbols loaded" error if my files have changed from the binaries expectation of those files creating a mismatch between what's running and what's displayed in visual studio. Again, making sure you clean the solution and rebuild it or restarting visual studio usually gets me out of trouble.
I am in charge of testing VS 2015 and how it works with our current applications for my employer. We currently use VS 2013 for everything we have, so I know there are no issues there. The problem I am having is that it appears the vshost.exe isn't terminating correctly or something. I have not narrowed down the exact issue but so far that is what I believe.
Here is how I get my error:
Run my app in debug
Open a few windows
Hit the "Stop Debug" button (the little red square)
Clean Solution
Rebuild Solution
After my rebuild I get the following errors in the EXE:
Error Could not copy "obj\Debug\APP.exe" to "..\..\bin\APP.exe". Exceeded retry count of 10. Failed.
Error Unable to copy file "obj\Debug\APP.exe" to "..\..\bin\CRM.exe". The process cannot access the file '..\..\bin\APP.exe' because it is being used by another process.
If I open the Task Manager and manually end the vshost.exe process I can successfully rebuild again, no issues. If I take the same steps, however, I am no longer able to build.
I tested these steps in 2013 and did not have an issue.
Also note that disabling the "Enable the Visual Studio hosting process" does alleviate the issue, however I do not want to disable this option.
Has anyone else had this issue? I know we are still early in release. Any suggestions/solutions to try? Is it possible there is something wrong in our code (which I highly doubt since I would then get the error in 2013, most likely).
Thanks for any help I receive!
EDIT: This is a WPF application written in .Net 4.0 using C#. Also, I have verified that the issue also occurs if I exit the application normally (IE I open a window then close it with the shutdown mode on LastWindowClosed)
SECOND EDIT: This is a new issue that presented itself in Visual Studio 2015 with the addition of the new live diagnostic tools.
I have found that if I have the "Enable Diagnostic Tools while debugging" option enabled in the debug settings I get this error. If I disable this option, the error goes away. I am not sure if this is a bug in Visual Studio but I would assume so, unless I need to do something else to shut them down properly. If anyone has comments or concerns, feel free to leave a note.
Probably late for the original question (and I see that he had a workaround), but as per MSDN, VSHOST.exe is only an enabler for improving Debug performance or facilitates scenarios such as partial trust debugging. If you do not need that support or can bear the cost of starting a process and attaching the debugger on each debug session, go ahead and disable the hosting process from project designer -> Debug -> Clear the box "Enable Visual Studio hosting process"
I am having great problems running the application in the debugger from Visual Studio 2008.
When I'm using vshost.exe, it says:
And when vshost.exe is turned of, it simply states:
Interesting thing about it is that when i do use vshost, debugger is actually started and breakpoint is hit on the first line of the Main().
I tried:
rebuilding the project(s)
removing .ncb, .suo, .user for the projects
repairing Visual Studio 2008
changing the build architecture for the project
... no help there...
Any experience in (trouble)shooting that?
More info: some projects DO work, and one that I have to work on, does not.
I have some ideas such as:
trying to create NEW project, add thing by thing to it and see at what point it will start to miss behave
work it other way around, delete project by item by item to see when it will (if it will) be working OK again.
EDIT (for google, as I see that there are many similar questions on the web):
Errors:
Error while trying to run project: Unable to start debugging.
and
Error while trying to run project: Unable to start program '....\PlayKontrol.exe'
Try upgrading your Visual Studio to Service pack 1, if you haven't already.
Did you restarted your computer? You never know how windows will react to that :).
Also be sure there aren't any keys stuck, like the ctrl or windows key.
Note that the key does not have to be visually stuck, it can be stuck for visual studio and not for the explorer.
The most common source of sudden problems like this is corruption of one of the data files that vs uses to cache information between builds.
You've tried a clean build, but this won't delete everything. A real clean build is: quit vs, delete bin, obj, debug, release folders, delete all generated files in the root - primarily ncb. Do the same for any locally built libraries that you're project references.
The easiest way to do this is if you have the code in source control, as you can rename away your entire code folder and then force a get of all the source.
You often need to do all of these things in one hit to clear the problem.
Less frequently, a reinstall of vs will sort things out (although this sounds unlikely in your case if it is only one project that breaks)
Also think carefully about anything you might have installed just prior to it failing... And remember that some install effects may not occur until the next reboot so it could be days ago. A particular cause of this are automatic windows updates and trial versions of things like the vs 11 beta.
You might try running the application from outside of VS, but have a line of code that looks like this: Debugger.Launch(); where you want your first breakpoint.
I am having a rather bizarre error when trying to debug a .NET web application.
My system: Windows 7 Ultimate (IIS7), Visual Studio 2008, DotNetNuke 4.8.2.
I have a Web Application which I am trying to attach the debugger to w3wp.exe. I set a breakpoint in my code: could be an ascx.cs page or a library I am referencing.
Here's the weird part. Once I run through that part of the website, the code breaks, and I am able to debug, step through between 1-20 lines of code, and all of a sudden it's as if I pressed Continue. The timing doesn't seem significant (sometimes it happens after 2 minutes, sometimes after 2 seconds) and there are no error messages in the output or Event Viewer.
If I try to attach the debugger with managed and native, it goes to disassembly mode for w3wp. Again, no real obvious error.
Anyone can at least point me in the right direction as to what could be interrupting the debugger? Without any error messages, I cannot even begin to figure out where to go next.
I've tried:
Rebuilding the website configuration in IIS
Check the app pool settings to make sure it's not timing out
disabled every conceivable service on my computer
Resetting my Visual Studio settings
Rebuilding the project
This is a bug in the VS2008 SP1 debugger. MS released a hotfix some time ago:
http://support.microsoft.com/kb/957912
The bug is described on that page as:
Stepping when you debug a managed
multithreaded application can randomly
turn into a "go"