Identify & Set Current Project in VS 2010 - visual-studio-2010

I have two projects in the same solution that share a lot of files so it's hard to know which is the current project. I know I can go to the Solution explorer, but that takes too long to navigate back to the project.
Is there any way to identify and set the current project on Visual Studio 2010? I'd prefer something like a dropdown list on the standard toolbar.
I know I can use the Solution explorer, but that takes too long to navigate to the project root.

Related

Customise Solution List in Team Explorer Home Page (Visual Studio 2015)

I am using TFS with Visual Studio 2015. On the Team Explorer Home window it lists solutions from my current workspace. This is a really handy place to open solutions from - however the solutions listed seem to be just a random selection from the workspace. It doesn't even list my recently opened solutions. Is there any way to customise this list?
Cannot be achieved.
However there is a workaround, after checking this option " Open Source Control Explorer to the most recent folder" in Tools→Options→ VSTFS, it will remember your last TFS tree selection and jump the very same branch and sub-folder again.

VS 2010 - Adding additional projects to Solution

At work we have just upgraded from VS2008 to VS2010 (keeping up with the times, I know). In VS2008 I used to navigate to various project folders in Source Control Explorer and double click the vbproj file and it would add it to my current Solution (or create a new solution if there wasn't one). The functionality in VS2010 seems to be that when I do this it closes my current Solution and opens the new project on its own.
Is there any way to get the VS2008 functionality back? I know I can right click on my Solution and Add->Existing Project..., but that takes a lot longer. I've tried Googling this but have come up blank.
Thanks in advance.
No, this beaviour was taken out from VS between 2008 and 2010. In 2010 when you double-click a *.csproj or *.vbproj file it will always open it up in a "temporary solution".
This gets annoying when comparing diffs between local changes to your project file... in my view VS should open it in the editor if anything. /rant

MS Visual Studio.net - saved source files missing after reboot

The other day I created a MS visual studio 2010 C# project and started coding. I saved the source frequently, but I did not select a destination to save to (just pressed ctrl+s and assumed the source was being saved). However I had to run and threw my laptop in my backpack on sleep. Unfortunately this laptop (acer aspire 5252 fyi) battery drains extremely quickly when on sleep, and eventually my computer shut off. Now I can't find my source files anywhere and I'm going crazy because I know I saved it and it's several days worth of work.
I tried doing a windows search but couldn't find the project files. I also did a little experiment - I created a new project and without saving the entire solution, I pressed ctrl+s on the source files. Save was successful, but I cannot even find the file that's open in the IDE. Even the "open containing folder option" is grayed out (see screen shot).
I really need these source files back. Obviously it's because I didn't save the solution that the source got wiped out, but where do the source files get saved temporarily before the solution is saved?
Thanks.
You are using Visual Studio's support for temporary projects. Nice feature for quicky test projects (and SO answers) but not a great way to ensure that your projects are still there after VS quits. Programming without source control is similarly inadvisable.
Tools + Options, Projects and Solutions, General. Ensure that the "Save new projects when created" option is ticked to minimize the odds that you'll forget to pick a solution folder. Triple-check that creating a new project now gives you a "Location" property in the dialog.
There is a default location for projects to be saved. That is probably where your files went.
In Visual Studio, on the menu, click Tools > Options > Projects and Solutions > General. There is a "Visual Studio projects location".
On my Windows 7 machine, the folder for Visual Studio 2010 is
C:\Users\<username>\Documents\Visual Studio 2010\Projects
Your unnamed project is probably saved with a default name like WebSite1.
If you would like to change that default location, here is some information on how to do that.
Visual Studio temporary projects are normally found in *C:\Users\"User Name"\AppData\Local\Temporary Projects* . It is a temporary folder that is deleted as soon as Visual Studio starts up.
How to save a Temporay Project from above link:
To save a temporary project
In Solution Explorer, choose the solution or project that you want to save.
On the menu bar, choose File, Save or Save As.
The Save Project dialog box opens.
In the , Name box, specify a name for the project.
In the Location box, specify where you want to save the project.
Select the Create directory for Solution check box.
Note: This check box is not available for Visual Basic web projects, Visual C# web projects, or other directory-based projects.
In the New Solution Name box, specify a name that differs from the project name.
Select the Add to Source Control check box if you want to add the solution to a version-control database or repository.
Choose the OK button.

View more than one project/solution in Visual Studio

I am new to visual studio and I am experimenting around with some Windows Services. I have created two solutions and I would like to view both of them at once. Without having to click file->recent projects to switch back and forth.
Ideally this could take place in the solution explorer and just nest the projects, but I am only able to view one solution/project at a time there.
Is there anyway to view multiple solutions/projects in Visual Studio?
This is the way Visual Studio is designed: One solution, one Visual Studio (VS) instance.
Besides switching between solutions in one VS instance, you can also open another VS instance and open your other solution with that one. Next to solutions there are as you said "projects". You can have multiple projects within one solution and therefore view many projects at the same time.
There's a much easier (but not so obvious) way; right click on the Visual Studio icon in the taskbar, then right click on the application name in the popup menu, then click "Open". Windows will then open another instance where you can open another solution in.
If you have two separate solutions, then you cannot view them simultaneously in the same VS instance. However, you can open multiple instances of VS and tab between them.
An alternative would be to import the projects from one solution into the other, thus putting all of your projects into one solution. You can do this by following these steps:
In the Solution Explorer, select the Solution into which you want to import a project. Right-click, and select Add->Existing Project from the context menu.
In the file chooser, find the project file that you want to import (it will end in .XXproj where XX is the language you're using).
Click Open and voila! Your project is imported.
There is a way to store multiple solutions in one instance of VS.
Attempt the following steps:
File > Open > Project/Solution
This will bring up the open project window, notice at the bottom where it says options, select add to solution
Then select the file you want to add and click open
This will then add the solution to your project. You still won't be able to run the same project in a single instance of VS, but you can have all your code organized in one place.
NOTE:
This worked for Visual Studio 2013 Professional
Just right click on the Visual Studio icon and then select "New Window" from the contextual toolbar that appears on the bottom in Windows 8. A new instance of Visual Studio will launch and then you can open your second project.
You can create a new blank solution and add your different projects to it.
You can have multiple projects in one instance of Visual Studio. The point of a VS solution is to bring together all the projects you want to work with in one place, so you can't have multiple solutions in one instance. You'd have to open each solution separately.
Don't know whether this is useful but if you want to work with multiple projects without navigating through projects tree {like multi window} you can try opening VS in another virtual desktop (at least it's possible for Windows 10) by holding Ctrl+win+D. Then open another VS studio and open your other project there. You can switch between projects by Ctrl+win+arrow key {left/right}.
Two ways come to mind...
Open another visual studio window and open the second solution in it.
It would be preferable to add your existing projects to one solution, just right click and add existing project and navigate to the project file(csproj). .... e.g. C:\Users\User\Documents\Visual Studio 2012\Projects\MySqlWindowsFormsApplication1\MySql Windows Forms Project1\MySql Windows Forms Project1.csproj ....In this second way you might want to setup multiple start up projects i.e. for people with client-server apps or apps with dependencies. ....To do this Select the solution then GoTo: Project>>Properties>>Startup Project>> Select Multiple Startup projects and set actions to Start. When you debug, the selected as start will run.
For interest sake you could open another multiple solution windows to view different projects at the same time. http://www.schwammysays.net/visual-studio-2012-tip-multiple-solution-explorers/
After a long research and different experiments the easiest way "FOR MAC USERS" is to create a script:
open -a "Visual Studio" \
"path to first sln" \
"path to second sln" \
...
:D
File -> New Window. Select the other project in that window. Each project lives in a separate window. You can tab between them.
MAC users - this issue was winding me up, as its not possible to open two different Visual Studio instances at the same time. Ive found a solution that works fine, though its a little unorthodox : get the latest beta testing version, which will install alongside your normal VS install in a separate sandbox (it does this automatically). You can then run both versions side by side, which is enough for what I needed - to be able to examine one project for structure, code etc., while doing the actual coding I need to do in the 'current' VS install instance.

Can you add documents and spreadsheets to a Visual Studio Project?

In Eclipse, I often include all project-related material (including documents in PDF, Microsoft, and OpenDocument formats) in the project. Is this possible with Visual Studio, especially to the point where if I attempt to open the file from inside Visual Studio, it will open in the external application?
Yes, just right-click your project in the solution explorer and goto Add > Existing Item...
Though -- I'd recommend making a new folder to keep this in.
Yes, you can make sure that when you open it it opens with the correct application. Just right-click the file once it's added into the solution explorer and select Open With... and make sure you set the default application that way from that point forward you can just double-click your files.
If you have access to use Sharepoint Services with your source control than that would also make life much easier, thanks for reminding me Chris!
I don't want to take away from Chad's answer. However, I will add that TFS has specific areas for project documentation to be stored in sharepoint.

Resources