Visual Studio scratch disk behavior - visual-studio-2010

I don't know if this feature exists, but I'd like a way to control Visual Studio 2010's scratch disk behavior (other than completely turning off intellisense).
Right now it creates a massive .sdf file in the project folder (50MB+), and then it goes and creates an IPCH folder with 60MB+ of precompiled headers.
All that's well and good while VS is running, but after it exits, I really would like the disk back.
Is there a way to configure vs 2010 to
Use the same location (%AppData%\VSScratch) for scratch disk files (so its easier to blow it away?)
Automatically delete .sdf /ipch on exit?
I know they don't delete them because its faster to startup.. but if you delete them yourself, startup time isn't that much increased..

Not sure if you figured this out yet, but what you can do is go to Tools->Options->Text Editor->C/C++->Advanced
then under that you can either completely disable the database or alternatively move it to a different location such as C:\VSdatabaseCrap\ ie: the fallback folder
This means your database files will still exist and take up diskspace, but the individual folder project folder will be MUCH smaller. This is useful for backing up to services like Dropbox, where you really don't care about your 200mb intellesense database.
http://blogs.msdn.com/b/vcblog/archive/2010/03/09/intellisense-browsing-options-in-vc-2010.aspx

Related

How do I save a solution in Visual Studio 2017

Coming from a Unix background and used to working with the Makefileto build stuff, I now have to find my way through the maze of twisty little passages known as Visual Studio 2017.
Basically: I just want to save a solution that I've imported into Visual Studio 2017 (e.g. to move it to another machine) to some sensible structure. I am unable to figure out how to do that!
The solution I work with comes from GitHub and the package is about 590 Kbyte and consists of 32 files. (I downloaded the .zip and unpacked it, then opened in the IDE by clicking on the .sln-file.
After running it (unchanged) in Visual Studio, it has ballooned to 4 Mbyte and 134 files. Obviously a lot of temporary files has been created as a result of me running it. Making a copy of this bloated directory structure is not practical - and some other way (i.e. the method for saving used by the guy who shared his solution on GitHub) must exist.
I want to save it with all those temporary files removed.
There is Build » Clean Solution – but it does not seem to get get rid of the temporary files.
I've also tried: File » Save all. I do no understand how this commend is supposed to work. It does not ask where to save tings, but just says "Item(s) saved" at the status bar at the bottom of the screen. Looking at things in the file system, I am unable to located anything saved. To me, it looks like this command does nothing.
I've searched, but so far found nothing for Visual Studio 2017 (recipes for older versions does not seem to work anymore.)
Saving a solution is something developers do a lot, so there must be something obvious I've missed.
There is not really the concept of "Save As..." for a solution. If you want to copy the whole solution elsewhere you would usually just copy the whole folder it's in to somewhere else.
The reasons you have many extra files are:
There will be a .git sub-folder which contains the Git repository. If you don't need to retain any link to this, you can delete / avoid copying this. Depending on how much history is in the Git repo this folder can even be much larger than the solution itself.
VS will create a .vs sub-folder for various housekeeping activities; you can usually avoid copying this.
In each project's folder, after you've built the solution, there will be obj and bin sub-folders. These are recreated as needed at build time and are not needed for a copy.
If you copy everything ignoring the above, you will probably find the size of the target is more as you were expecting.

VB.NET file has become an unreadable format

So the images below were originally a vb files. I have just opened it and it looks like this and the compiler won't run it. I am unsure whether this is a compiler error or whether it may have become corrupt because the project is stored on an external drive. It is just these two forms that have broken like this; I have one other form and a module in the same project that are okay but the project can't run because of the two that are broke.
Broken Login Form
Broken Diary Form
If it changes anything, the designer files for the forms are intact it is just the scripting for the forms elements that is broken.
Also, if I can't identify the cause, is there a way to revert it back to the last working version in visual studio to get my code back? Just because I put a lot of time into it.
The data in those files is most likely gone.
IMPORTANT: Do not write anything to that disk drive unless you find that you cannot recover those files.
If you are using a version control system then you can revert to an earlier version.
If you are using Windows 10 and you happen to have stored those files in a location included in what File History saves, you can recover them from that.
If you use some other form of backup, retrieve the files from that.
If you have a separate disk drive with at least as much free space as the one with the corrupted files, you could try running file recovery software as it might be that the zeroed-out file was written to a different place on the HDD.
TinTnMn pointed out in a comment that if you previously compiled the code, you should have executable files in the "obj" and "bin" folders that can be decompiled to recover most of your work
It could be quicker to re-write the code while it is still fresh in your mind.

What folders does Visual Studio 2013 (and ReSharper) use?

I work in a corporate Windows 7 environment where our profile is stored in a central server in a different location. Thus, opening a solution in Visual Studio containing 100+ projects takes a considerable amount of time (network latency and limited bandwidth), even though I have checked out TFS into a local folder (d:\src).
What folders does Visual Studio 2013 SP1 use for temporary data while working, and how can I override them to use specific folders which I know for a fact is on my own SSD drive?
ReSharper stores info in %LOCALAPPDATA%\JetBrains (local) and %APPDATA%\JetBrains (roaming), mostly. The interesting files are:
Global settings and extension metadata (e.g. the list of installed extensions) is stored in %APPDATA%\JetBrains\ReSharper\vAny
Extensions are installed to %LOCALAPPDATA%\JetBrains\ReSharper\vAny\packages
Solution caches are stored in %LOCALAPPDATA%\JetBrains\ReSharper\vX.X\SolutionCaches
VS version specific, static caches are also stored at %LOCALAPPDATA%\JetBrains\ReSharper\vX.X\vsY.Y (specifically a binary form of the xml index of external annotations)
Annoyingly, pdb files downloaded as part of the "external sources" feature are not cached in a JetBrains folder (I have raised an issue on this):
%LOCALAPPDATA%\RefSrcSymbols for files downloaded from Microsoft's reference source site
%LOCALAPPDATA%\SymbolSourceSymbols for files downloaded form symbolsource.org
%LOCALAPPDATA%\Symbols for files downloaded from servers declared in Visual Studio's Symbols options dialog page
%TEMP%\Symbols is used for symbols downloaded via the _NT_SYMBOL_PATH environment variable, unless a better cache is specified in the environment variable itself
If you're concerned simply about roaming profiles, you should be fine with ReSharper - the data stored in the roaming part of the profile (%APPDATA%) is minimal - 96Kb on my machine, for example.
But if your whole profile dir is redirected to a network share, including the %LOCALAPPDATA% section, then you could be in trouble. The solution caches can be huge, depending on how many different solutions you have (I'm over 1Gb, but with lots of BIG solutions) and the extension packages can add up too, especially since 8.2 has started shipping the external annotations as an updatable package (it takes about 60Mb).
Fortunately, you can change the settings to tell ReSharper to put the caches either in the solution dir, or %TEMP%, which can help (but make sure you ignore _ReSharper.*\ in your source control if you put them in the solution dir!).
Unfortunately, you can't move the extension package installation dir. ReSharper assumes that %LOCALAPPDATA% is actually a local part of the profile, and can be used to store data that won't get roamed with your profile.
Visual studio 13 use temp folder as same as system's own temp folder
My image show G:\Temp which I customized to work with RamDisk. Using Ramdisk drive for temp certainly improve the speed of many application.
If you have more RAM then you can create RAMDisk that is many time faster then SSD. Ramdisk is not safe for storing since the data can be easily lost when crash happen. You can better use it for cache that I have done in my PC.
https://devblogs.microsoft.com/visualstudio/improving-your-build-times-with-incredibuild-and-visual-studio-2015/

Include in Project slowness with Visual Studio 2010

Our company won a web project from a new client. Their old vendor basically zipped up the code (C#/ASP.NET, including an enormous number of media files) and FTPed it to us and is no longer answering phone calls/supporting it in any way. There's no solution file, no project files, just code.
So I created an empty project locally and moved it to a network path and moved their code inside it because I don't even have enough space to host it locally. Their architecture is suspect, but I need to get it back up and running ASAP so I don't have time to reconsider that at the moment. I opened the project I created, selected "show all files" and attempted to include all of the paths (both media files and code paths) and the application hung. One of the media folders has something like 65,000 files in it. Do I even need to include this?
Regardless, it seems like doing "Include in Project" is taking forever, I've spent hours wrestling with it, trying to do one folder at a time...but often it's just hanging and I have to kill the process. Is there a faster way to deal with this? I tried editing the project file directly but including this media folder made the solution take absolutely forever to load.
Any general suggestions on how to approach this situation?
as long there is no direct reference you don't need to include media files into the project.
I bet those files are just loaded runtime from a procedure. To make sure make a full search for the media folder in the sources.
Imho get just the files to a local store, create a solution, and then add all resources and sources. If needed you can copy the media files later again into the project.
I had the same problem with local files. I probably killed VS2010 three times since it would always seem to lock up. I then recreated the folder structure, but not with the correct name, then save the project, open it with a text editor and change the names to the actual structure. Finally use "Add > Existing Item". It's still slow, but a bit faster.
It's not hanging - if you leave it long enough it will finish. Know what you mean though - it took half a day to include dojo on one of my projects.
You may want to try SharpDevelop to include large folders into your projects - it seems much, much faster than visual studio when given this task. You can then just re-open the project in vs. Hope this helps.

Changing the default Source File Directory in Visual Studio

This is not a work-stopper in any way, but I thought I should ask anyway because it is a little annoying. Let's say I create a new project and start putting source files in a directory other than the default that shows up the first time. Afterwords, whenever I open the project, I have to navigate to the source directory once during that session. Like I said, not a big deal (but if solvable, then it's icing on the cake). Quite a few times I absentmindedly put the source file in the default directory and end up committing that file to the SVN and if I am lucky, going through all the files, removing them, then adding them again.
So my question is, is there any way to specify the default source directory on a per project basis?
I have run into the same nuisance. I like to put the public interface header files for a library in a separate directory, but end up with file directory typos because I forget to navigate to the correct directory when saving a new file. Unfortunately, Visual Studio does not offer a setting to change the default directory for new C++ source files.
I had the same problem when I started using build systems (CMake, Premake) which requires me to keep my project files separate from my source files, which hampered my workflow.
Although changing the default source directory seems impossible, if you aren't afraid to spend money, the workaround I found was to use the Visual Assist extension.
You can bind a shortcut of your choise to the Create File command which creates
a new file relative to the directory or your open file.
I'd also recommend to base one's workflow around the wonderful
Create from Usage command (which I think greatly boosts
productivity) which almost eliminates the need to manually create files.
The extension is great, albeit a bit costly. I would love to see Microsoft incorporate these features directly in the IDE eventually as they are found vanilla in a lot of other IDEs e.g. Eclipse, Intellij.
There might be some free extensions available that does the same thing, but I haven't found any.
Changing the Default Project Folder may help. This page demonstrates how to change the default for Visual Studio 2005, and it should be the same for later versions.

Resources