Visual studio not updating to code changes being made - c#

Had a roam around Stack Overflow to try and find ways of solving this and am yet to come across a method that works. Have a project built in C# with an Angular front end. Recently published to a server, which works fine. However now when I try to make changes to the code locally and run in debug, the build does not pick up on any of the changes being made, I've tried restarting VS, updating VS, restarting my PC, cleaning the solution, having Configurations Manager ensure that the project is not run on old builds. Anyone know why this kind of thing is happening?
Thanks in advance!

Related

Visual Studio 2017 won't show anything in stack trace and than crushes my application

I've been working on xamarin to build a crossplatform project on VS2017. I'm in the late phases of development and everything used to work fine. Couple of days ago while coding, I took a brake and updated windows. Since than my visual studio has gone "crazy" . Every time I deploy an application on a device and trying to debug it, it will only show a message in the stack trace and then it will crash my app.
This is what it shows :
Android application is debugging.
In this moment the app will reopen and than crush. It's a very strange behaviour. I of course tried different apps which used to perfectly work, and they have the same issue. I even tried it with a brand new application. Same thing. And of course the app works when I build it from my windows PC to an Iphone or iphone simulator. I can't wrap my head around this.
Has this happened to anybody lately? Is there a problem with the PC or a problem with the VS2017 ???
A little help would be very appreciated. :)
== edit ==
My VS2017 version is : 15.4.2 . Is there any known problem with this kind of version??
try to enable Exceptions
Debug > Windows > Exception Settings
Probably this can be a problem of the emulator. In short, get a fresh installed copy of the .android folder by installing vs on other pc, delete the current one, RESTART your PC and paste the copy to its folder.
To makr things more clear, I believe its good to share my attempts. What I noticed from my experience is, the emulators start behaving odd on your normal debug process. The reasons can be different, some of which were, according to my experience, sudden pc shut down, using large file size images as drawable backgrounds, closing emulator before debug was complete and so on.
Once such odd behavior happened to the emulator, I tried everything I could access online to reset the emulator or create a new one but none solved my problem, even reinstalling vs2017. Finally I was left with one choice which I still think is a foolish idea. Backed up and reinstalled windows, reinstalled VS2017 and other software I needed at that moment. When I was done with clean installation, before I started my work, I copied and backed up the .android folder (almost 10GB for the four default installed emulators) that is located in the user folder and continued my work as usual. And if the emulator fails again at anytime (like even in cases of black screen, being super SLOW, Launcher not responding...), I DELETE the current .android folder in the current user folder, make sure all of the emulators ARE NOT available for the debug option (replaced by start) in visual studio, RESTART the pc (important), copy your backed up .android folder and paste it back to your user folder where it was originally located.
Then you are good to go. I hope this will help someone.

Debug async code in Xamarin iOS

I seem to be unable to debug any code which uses the async keyword. Does anyone have any idea to solve this? I am completely clueless. I tried different linking settings as suggested by several people, however without success.
Any breakpoint before the use of async works.
EDIT: When I open the solution with Xamarin Studio on a mac, debugging the code works just fine. However I would prefer to develop in Visual Studio.
ANOTHER EDIT: I 'resolved' it by creating all the projects in Xamarin Studio. If I ever find out what the problem was, I will post it here.
You could try to clean the solution and build it again, also delete the app from your device.
It is possible that you could be running unmatched versions of the code.
Restart your machine, after done DO NOT start VS yet
Navigate to C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root
Delete all debugging caches
Do the same for this folder..C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root
Start VS, make sure its running as admin.
Set your breakpoint, verify symbols are loaded and breakpoint holds.

XAML changes does not update after build

I am creating a WPF application. I have worked on it for more than 6 months with no problem, but now, suddenly, any modifications I make on the interface, will not be updated after I build.
I am using VC# Express edition.
I tried other projects and they work fine.
Have you tried cleaning the solution and performing a full rebuild?
Clean solution is found in the "Build" menu.
Maybe you have errors, and disabled the message, telling you about these errors, then the debugger runs the old version without errors.

VS 2008 suddenly can't start debugging session

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.

Pressing F5 in Visual Studio 2010 Builds but does not Launch Application

I have a Click Once application (WPF) in C#. Initially when I would hit F5 to debug/launch the application it worked smoothly. Eventually, F5 only would build the solution and not launch the application (therefore I could not step through my code). For a short while I switched from Debug to Release mode and for some reason that allowed the application to launch after using F5 and I could step through my code again. But now that no longer works either. Long story short, I cannot get the application to run in a manner that allows me to step through the code. I can only do a Start without Debugging (Ctrl + F5). Obviously this doesn't do much for me other than tell me if the application works or not.
The thing that worked for me today was to open Task Manager and look for any debug programs that didn't terminate properly.
Task Manager > Processes > kill all programs "*.vshost.exe *32"
You probably have lost your start up project in the solution, or the start up project is messed up, and no correct "item" is defined for the startup.
Right click on one of your projects, and select : define as startup project.
Then retry that should do the trick. If not, check in that projects properties to see if a form or something is defined as the startup object for that project.
Edit : Obviously dont define a class library project as startup project, but choose your UI :).
I had this same issue today and came here looking for help. I tried all the suggestions here and nothing helped.
Seeing as my solution was a simple console application I recreated it from scratch. The new solution didn't exhibit the problems, so I started comparing the two.
I reset the solution and project files so that they were identical (apart from Project GUID, name and root namespace) but the first solution still didn't run.
I then tried deleting the suo files, and the bin and obj folders. Still the first solution wouldn't run.
Finally, I noticed the vshost.exe process was still running for the project. When I killed that and reloaded, it all started working correctly.
I just had this problem today. The solution turned out to be a slight twist on the issue with *.vshost.exe mentioned previously.
I could build the application just fine but msvs refused to launch it. I could manually launch the application and the time stamp on the file indicated that it was in fact a fresh build as well. *.vshost.exe wasn't showing up in the task manager, so I couldn't end the process as suggested.
When all else failed, I tried deleting the .exe's and found that *.vshost.exe would not delete because it was in use. The error message indicated that it was actually the steam client (third party software) that had somehow grabbed my *.vshost.exe file and was "using" it. Not sure how or why. At any rate, I completely shut down steam, then it let me delete *.vshost.exe. After that, building and running from msvc worked normally.
Had the same issue, eventually tried deleting all breakpoints and the debug started working again. Yet to figure out why, but at least it works.
As well as the ghost *.vshost.exe. It could also be that you have the same Solution/Project open in another version of VS. I had the same Solution open in both VS2010 and VS2015 and when running in VS2010 it compiled but failed to start. Closing the VS2015 Solution and it ran as expected.
After years of using VS 2008, I suddenly had the F5 problem not launching the application. There must be a dozen different suggestions out there - I tried a few. Someone suggested a virus. My Microsoft Security Essentials was not automatically updating (a common problem it seems), so I manually updated it. It found a virus, removed it, and the F5 problem went away !
Had this problem and tried to delete everything in bin/debug folder but could not delete vshost.exe file - kept requesting admin permission and then still could not remove it even though running from admin account. Restarted and file was gone and f5 worked again

Categories

Resources