• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 520
  • Last Modified:

How can we prevent VB.NET to save everytime we run it

We have a programmer reviewing important code and we found that when we test-run the code from within the development environment, it always saves the code.  This is causing to reload from backups when something goes wrong in the code.

We would like to have VB.NET behave like VB6 that we can modify the code, run it, and when exiting, VB6 "ask us if we want to save.  In VB.NET, it always saves the code when running.

Can this be done in VB.NET ?
0
rayluvs
Asked:
rayluvs
3 Solutions
 
käµfm³d 👽Commented:
To turn off automatic saving, you can go to Tools->Options->Projects and Solutions->Before Building. You will have several options there to choose from.
Untitled.png
0
 
käµfm³d 👽Commented:
Correction to settings path:
Tools->Options->Projects and Solutions->Build and Run->Before Building

Open in new window

0
 
Fernando SotoCommented:
Hi Ramante;

When the project is opened on the main menu click on Tools => Options... When the Options window opens In the tree view on the left expand the node Projects and Solutions and then select Build and Run. On the right hand side of the window you have a combo box called "Before building" it has 4 options an there meaning is shown below. One of the last two options is what you are looking for.

Before building
Save all changes
Automatically saves changes to the solution file and all project files that were changed since the last build when you press F5, or click Start on the Debug menu or Build on the Build menu. No prompt is given. Items are saved with their current names. By default, this option is enabled.

Save changes to open documents only
Automatically saves changes to all open documents when you press F5, or click Start on the Debug menu or Build on the Build menu. No prompt is given.

Prompt to save all changes
When selected, displays a dialog box that asks whether you want to save changes to the solution and project items when you press F5 or click Start onthe Debug menu or Build on the Build menu. The Save As dialog box is displayed so that you can assign a name and location to your project. If this option is not selected, the project runs by using the memory image that contains your changes, but the changes are not saved.

Don't save any changes
When you run your project, the integrated development environment (IDE) runs the code version in the open documents and does not save changes to open documents.

Fernando
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Jerry MillerCommented:
Other than files that need to be writable, (the bin directory for one), all of your files should be set as read only to prevent 'accidental' changes. It is a little of a hassle, but I am always warned before my changes are saved. Our versioning software marks all files as read only, unless you choose to make them writable.

Your testing coders should be using a back-up version (or a copy) of your code anyway. That way when anything goes wrong (and it will on occasion), your copy is untouched. You make necessary changes and provide them with a new copy.
0
 
Fernando SotoCommented:
@kaufmed you are quick.
0
 
käµfm³d 👽Commented:
@FernandoSoto

...and you, sir, are thorough  = )
0
 
Fernando SotoCommented:
Hey we make a great team then..  ;=)
0
 
rayluvsAuthor Commented:
Good Team Work!
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now