VS Code : Differences between options under File menu - menu

In Visual Studio Code, as you might know, there are many options under File:
Open file
Open folder
Open workspace
Add folder to workspace
etc.
Could anyone please tell me the differences and benefits to choosing any of these over others? VS Code clearly sits gently on top of the File system, and is not heavily configured (say like, VS 2017, NetBeans, Eclipse, etc.) - it is of course closer to its sibling, Atom.
But I'm not entirely sure the advantages or recommendations related to, for example, Add Folder to Workspace vs just Open Folder, saving the workspace (or not), etc.
Any help would be appreciated.
Thanks a ton!
-J

1. Firstly open file is just the option to edit or open a file.
2. Secondly opening a folder is the option to import your project directory in the editor.
3. Then comes the workspace option which is quite similar to the open folder option with the difference that every workspace has its custom working settings.
VS Code provides two different scopes for settings:
User Settings - Settings that apply globally to any instance of VS Code you open.
Workspace Settings - Settings stored inside your workspace and only apply when the workspace is opened.
Workspace settings override user settings.
For more details you can refer to VS code settings (docs)

Related

Does VS make a 'virtual solution' for projects without a solution?

Having opened a specific Visual Basic project from source control mapped folders, the project appears to have a solution — containing only it. The properties window says the path is the same folder as the project, but I can’t find the solution file at the specified path OR anywhere in my local drive.
Is it possible the solution file was somehow not checked in or doesn’t exist?
Actually, that's just an unsaved solution.
If you hit Save All, VS will show a Save As dialog for that solution file.

Change default gitignore file when creating a new project

Is there a way to change the default file .gitignore that Android Studio creates when creating a new android project? I searched for it in the Settings but could not find anything.
Unfortunately, there is no way to do that automatically, besides the one Ted has mentioned.
However, personally, I don't see this as a big downside, because you can thus safely add your specific templates that fit best to your project.
To be able to do this, do the following:
Go to File -> Settings and from there highlight Plugins. Click on Browse repositories... and you should be able to find the plugin entitled .ignore. Install it.
Now to configure a .gitignore for any project, in case you have no project opened, click on Configure -> Settings. In case you have an open project, go to File -> Other Settings -> Default Settings…. Now expand Version Control and click on Ignore Files Support. You should be able to add a custom user template of your .gitignore-file there.
To use any template you've added there, just right click on your .gitignore and click on Add template…. There you'll be able to add your custom specifications, however, many others are given by default, so you don't need to do a google search for an OS or language specific .gitignore configuration.
Good question. I tried manually modifying the project_ignore template in the Android Studio installation (located at C:\Program Files\Android\Android Studio\plugins\android\lib\templates\gradle-projects\NewAndroidProject\root in my Windows installation). That works, but it causes any future updates to Android Studio to fail unless you restore the original template first.
I'm posting this as an answer because it works. But it has such a bad down-side that I'm also starting a bounty in the hopes that someone can come up with a better solution.
On Mac, Applications->Android Studio.app(right click -> show package contents) -> contents-> plugins\android\lib\templates\gradle-projects\NewAndroidProject\root\ , i tried modifying, project_ignore file. i dont see error every time while looking for updates. instead of replacing, i appended at the end.

Unable to ignore files in Visual Studio 2012 using .tfignore file

I'm having some problems ignoring files in VS 2012 and was wondering if anyone could help. Essentially what I'm trying to do is ignore the Web.config file from a project in a solution.
I'm aware of the ability to "Exclude" the file but I wanted something a little more robust as I really don't like the way that VS re-includes the files when I right click the solution file and click "Check In".
Here's what I've tried so far:
Made a change to the Web.config
Team Explorer tab->Excluded Changes->click "Detected" link
Right click a file->"Ignore this local item" to create .tfignore file*
Open the .tfignore file and append "*.config". Saved.
Reopened VS
Opened Team Explorer tab again->Pending Changes
Web.config still appears in the "Included Changes" list!
As explained on http://msdn.microsoft.com/en-us/library/ms245454(v=vs.110).aspx#tfignore
Visual Studio seems to just completely ignore my .tfignore file.
Does anyone have any ideas/workarounds? Cheers.
You'll have to make sure you are using a local workspace (can be configured in the advanced part of edit workspace). The .tfignore file should apply as long as it is in your workspace. It will apply recursively to any subfolders and can be overridden by another .tfignore in any of the subfolders. Here's the reference for the .tfignore :
http://msdn.microsoft.com/library/vstudio/ms245454%28v=vs.110%29.aspx#tfignore

Visual Studio 2012 - Database Project - setting a default profile for publish

Just wondering if anyone knows how to set a saved publish profile as the default i.e. profile that's automatically loaded when I select publish. I love the new profile approach but I'm a bit over having to reselect the same profile over and over while I'm developing.
In VS2012 and up, you can set the Default Publish Profile by right-clicking on the .xml profile file and clicking the Set As Default Publish Profile option. It will then be auto-loaded when you click to Publish the project.
So I've just discovered how to do this, right click on the specific .xml file (e.g. Debug.publish.xml) that you wish to publish and it is automatically loaded into the Publish panel.
Double clicking the XML file also works
The latest Visual Studio 2012 Updates also now include right click options for:
1 - Set as default
2 - Publish
Rob, you may want to consider setting up some batch files that call SQLPackage to use your desired Publish profile. I blogged about it here: http://schottsql.blogspot.com/2012/11/ssdt-publishing-your-project.html
For our dev team, we have a set of batch files set up that can build one or all databases locally from whatever branch they're currently using. That makes it a lot easier to update the local database. The "Publish All" batch file takes a little time to run but is still better than opening each project individually to publish the databases.
Slightly odd issue: I renamed my .xml file to .localdev.xml....file name is "double extension'd" - VS/Datatools looks for ".publish.xml" NOT just the .xml file. In my case I needed "*.localdev.publish.xml". When it had the wrong name the "Set as Default Publish Profile" right click option DID NOT show up, nor did double-clicking...where is Molder when you need him?!?!? ;)
Get the name right, get the right functionality......MS needs better, more creative QA people!! ;)

Under what conditions will the Visual Studio 2012 Difference Viewer allowing editing a source file

Rather than continuing with Winmerge as my tool of choice, I've decided to commit to using the Difference Viewer built into Visual Studio 2012 Premium especially given it uses the edit window providing intellisense and resharper integration.
However, I've noticed that in one solution I compare a local file with latest and I'm allowed to edit the source file. However, in another solution which exists on the same TFS 2010 server but a different project and is checked out to a separate workspace, I'm not allowed to edit the local file.
According to the Visual Studio 2012 Help ("4. The Diff window appears. You can continue to make changes to the file in this window.") I should be able to edit the file if it is local. I will also need to be a member of the Contributors TFS group (I'm actually a member of the Project Administrators group too.)
I've tried running the compare from the command-line too something like "tf difference filename.cs" and compared two local files but they're all still read-only.
Can someone confirm what conditions I need to meet in order for the local file to be editable in the difference viewer?
UPDATE: I'm not sure how I missed this but it would appear that it's .aspx files that can't be edited in any of my solutions!
If you click the Merge button instead of Compare Files, you get a slightly different diff window that lets you edit the local file. Also see the edit in the answer about aspx files.
You can only edit certain file types in the Diff viewer. Example: You can edit .cs, but not .sql files.

Resources