VS2022 Hot Reload unconditionally restarts application after changes - c#

for C# there's this option in VS for hot reloading, to automatically rebuild and restart the application. This is usually necessary when the changes couldn't be applied while the application was running. In practice, this happens a lot when you have a syntax error and press save. Unfortunately, I checked the option "always rebuild when changes can't be applied while running the application" (I don't remember the exact name of this option). So now, each time when I have a syntax error and accidentally save the file, it exits the application I'm debugging, while I could have easily fixed the syntax error and saved again, without restarting.
Is there a way to restore this setting such that the dialog pops up again, asking me whether I want to continue editing or restart the application? I believe this dialog is called "rude edit". I tried to find the option in the settings of Visual Studio, but could not find it.
A work-around is to disable hot reloading on file save, and manually triggering the hot reload after I save a file, but I'd rather have the old behavior.

Apparently, this setting persists during the lifetime of a single VS session, and is reset if you restart it. I should have read it better before clicking the checkbox.
Hot Reload dialog
For completeness, the caption of the checkbox is "Always rebuild when updates cannot be automatically applied. This checkbox will be reset when the solution is closed."

Change "release" and select "Debug".

Related

Visual Studio 2012 "Unable to start debugging"

I am trying to host web services with IIS Express on my local machine. I can start debugging one time. Every time after that I get a dialog box with "Unable to Start Debugging" whenever I try to run the project. If I shut down VS 2012 then open back up it works one more time. I see the issue in this post.
I believe it has something to do with my password changing a few days ago. However, I can't find where my credentials are stored and I have no idea how to change this configuration. Please help!
UPDATE:
Turns out the same thing happens if I try to run a local console app. This means (I think) it is a VS setting somewhere. I was having to shut down VS and restart it every time. However, I did find that if I shut down these tasks and then debug it works:
Any ideas?
It appears from your screenshot that IIS Express is not shutting down when you stop debugging. This is actually a setting in Visual Studio called “Enable Edit and Continue”. When enabled, IISExpress will close when Debugging ends and if disabled IISExpress will remain open.
This setting is normally set on by default in Visual Studio 2013, but actually defaulted to off in versions prior, including 2012, which you state you're using. You probably want it ON.
To adjust globally:
Open Options dialog box by clicking Tools -> Options
Click Debugging -> Edit and Continue
Toggle "Enable Edit and Continue"
You can also turn adjust on a per project basis.
Open properties for web project
Click Web tab
Toggle Enable Edit and Continue" under Debugger at the bottom of this page
Further reading on MSDN here:
https://blogs.msdn.microsoft.com/webdev/2013/07/11/enable-edit-and-continue-debugging-option-is-now-on-by-default-for-new-web-applications-in-vs2013-preview/
First Check the Identity settings
Update your credentials in the "Identity" setting, under IIS/Application Pools.
if your password had recently changed, the "Identity" might still set to your old credentials.
OR
Reset Visual Studio Settings
reset visual studio settings and restart it again.
On the Tools menu, click Import and Export Settings.
On the Welcome to the Import and Export Settings Wizard page, click Reset all settings and then click Next.
If you want to save your current settings combination, click Yes, save my current settings, specify a file name, and then click Next.
—or—
If you want to delete your current settings combination, choose No, just reset settings, overwriting my current settings, and then click Next. This option does not delete default settings, which will still be available the next time you use the wizard.
In Which collection of settings do you want to reset to, select a settings collection from the list.
Click Finish.
OR Check Truely Reset VS

How to stop MS Visual Studio Express 2013 from overwriting save files automatically

Whenever I do some changes to my program and run it in debug mode, I cannot go back to before the changes. ctrl+z does not work(grayed out) and opening the project or file also doesn't work.
Is there a way to stop it from overwriting my savefiles? Do I have to save it with another name each time I try something new?
To run a program you need to build it, and to build it, you need to recompile your program from source, this requires that the files be saved, otherwise debugging wouldn't work because the files wouldn't match the code being executed.
If you want to make changes as you debug, look at "Edit and Continue", or copying+pasting your changes to a notepad window as a temporary buffer.
...and use source-control.

IIS Express Immediately shutting-down running site after stopping web application

I'm using visual studio 2012 in the first days when I want to stop application in IDE, application was still running on IIS Express, I could browse and work with running application, but now I can't. IIS Immediately shutting-down application if I press stop button. Since I remember I didn't make any changes in setting. How should I do that running same as first days.
I recently faced a similar situation when suddenly my IIS Express stopped right after I stopped debugging. This happened after I turned on "Enable Edit and Continue". So if you disable this you will see that IIS Express stays running even after debugging is stopped.
Right click your project > click Properties > select the 'Web' tab on the left > uncheck the Enable Edit and Continue checkbox.
In VS2010 and VS2012, the edit and continue option is disabled by default when creating a new web application project. In VS2013 it is turned on by default.
You can find this option on the Web tab in the web project’s properties window.
With “Enable Edit and Continue” on, the VS debugger starts your web application in IIS Express. When you stop debugging, IIS Express is closed too. With this behavior, you will see the IIS Express system tray shows up during debugging and gone after debugging. This behavior is the same as in VS2012 when the Enable Edit and Continue option is turned on.
If you don’t need "Edit and Continue" functionality during development and would like IIS Express to stay after a debugging session, you can simply turn the Enable Edit and Continue option off.
If you want to use "Edit and Continue" or you are developing an Asp.net 5 site (ASP.NET 5 projects don't have an Edit and Continue checkbox in project properties) you have to use the "Detech all" command to stop debugging.
The debugger will detach from the iis process without closing it.
Clearly "Edit and Continue" feature will not work until you start debugging again.
Instead of hitting the (X) STOP button, you can use the Detach all menu item in the Debug menu. The major difference is that the stop button will terminate any process that is currently being debugged, while Detach All will disconnect the debugger from the processes, but will not terminate them.
The normal IIS worker process would also be terminated, but since it used to be running as a service, it will also automatically start up again and thus you could continue to use it without having to restart the process through |> Debug or |> Start without debugging.
Screenshot for Reference
It seems like since the release of Visual Studio 2015 Update 2 the accepted solution no longer works.
The easiest solution I've found so far is to start the project by selecting "Start Without Debugging" from the Debug menu.
This is probably best categorized as another workaround, but it works for me.
I generally start the project for the first time with the "View in Browser" context menu (or CTRL-Shift-W).
From then on, anything that requires debugging, I usually attach to the new existing iisexpress process. While mousing thru context menues would make this a non-starter, it is nearly as quick as F5 with the following keystrokes:
Shift-F6 to build the current project or Ctrl-Shift-B to build the
entire solution (this is only required if you have made changes but I
thought I should mention it since F5 already does this).
Ctrl-Alt-P opens the attach to process dialog
typing "iis" will then bring you down to the iisexpress process
hit enter and you're attached
If you have more than one iisexpress running, the last one started will generally appear at the top of the list. Another option is to shift-select and attach to all of them.
This has a number of advantages IMO. First and foremost, it doesn't terminate the process. Second, the browser window isn't closed when you stop debugging. It cracks me up when I see a developer repeat 7 steps to get to reproducing a bug, when all he needs to do is hit F5 in an existing browser window to just repost once the debugger is connected. Last, I have to do this already when attaching to nunit, so I get a more consistent experience.

Cannot see changes I make when I run my application in Visual Studio

I make changes in .cs files and also some changes with the designer. After this I compile and run the project.
The problem is that it shows the my old form, and it does not show the new changes I made in the form.
In other words, I don't see the changes I made when I run my application.
Try to Rebuild or Clean/Rebuild project, of course first be sure that you Build it after change.
When you have compilation errors and stuff like that Visual Studio will pop up a windows asking if you want to run the last successful build. It has a checkbox that says "Do not show this dialog again". If you have previously checked that box it can produce something like what you are talking about.
This may not be your problem but at the very least you should check it out, just in case.
The window looks like this:
To fix it go to your Tools->Options then:
I don't think it is a problem, you may not building the application.
I would check your Configuration Manager for your solution. It's possible that your active solution (e.g. the solution type specified by your Configuration / Platform combination) is not set to actually build the project.
The Configuration Manager has a Build column with checkboxes. Ensure that all the projects you want to build for a configuration are set to build.

how do I view all of my pending changes in VSTS Source Control Explorer?

I'm relatively new to TFS and perhaps because I'm a novice,
I'm not too thrilled with its behaviour.
Scenario:
I copy a source tree from the TFS server to my local hard drive.
I open a solution from my local hard drive by browsing to the .sln file.
From the vs Solution Explorer I double-click a .cs file.
Even though I'm just looking at it, that file is often marked as checked out to me. This happens for example if I accidentally insert a blank line, even if I undo the accidental insert and even though the vs tabs imply that the .cs file is locked.
Even though I've changed nothing, Source Control Explorer acts as if there are pending changes.
I am able to right-click the file and "Undo Pending Changes...".
QUESTION: how can I get a list or report from TFS that shows ALL of the files tagged with my Windows user id?
You just right click the folder in Source Control Explorer or the solution tree...whichever you want to see under, and view pending changes.
Alternatively, if you're against a single TFS server, go to View -> Other Windows -> Pending Changes
Also, Attrice TFS Sidekicks has some handy tools for this you might want to check out.
Menu: View -> Other Windows -> Pending Changes
If you open more than one VS instance, the window content might be out-dated, so hit "Refresh" button on top of Pending Changes tool window to be sure.
You may also want VS to prompt you upon check-out, to make your life easier.
Go to Tools -> Options -> Source Control -> Environment -> Checked-in items
and change the values to "Prompt for Checkout"

Categories