How to add the currently edited file to project - visual-studio

In Visual Studio 2013, often I am editing a file that is not in the current project, and would like to add this file to the project. Is there an easy way to do that? The only way I've found is via right click on the project, Add/Existing Item (Shift+Alt+A), and then browse to the file I want to add in the dialog. Is there a shortcut I am missing?

This works in Visual Studio 2010:
Right-click on the document tab, select "Copy Full Path".
Project - Add Existing Item - Ctrl+V - Add.

Related

How to add a PDF file to a visual studio project?

Is it possible to add a PDF file to a visual studio project? If it is, how?
You must first add the PDF to the file system, inside your project directory. After the PDF document exists inside the project directory, go to Visual Studio and click the Show All Files button which is found in the top right of the solution explorer window. If the file is not visible, you may need to click the Refresh button. Then right click the PDF and choose Include in Project.

Visual Studio 2010 Ultimate does not allow to add Reference

I want to create a DLL folder where i want to put all my dlls and I need to add a reference to this folder in Visual Studio. But when I right click on the Project-->References.. and then click on Add Reference, only the "Projects" tab appears, empty, and you cannot do anything.
Did anybody have the same problem?
You just have to choose the Browse tab instead of the Projects tab in Projects > Add Reference.

Edit project file in Visual Studio 2010 using TFS2010

I've got a solution checked out from our TFS2010 system and want to edit the .csproj file itself in native text format (and not via the Project->Properties). Until we introduced TFS2010 I just edited the .csproj file in a simple text editor. How can I edit the project file regarding TFS2010 CheckIn/CheckOut mechanisms?
Many Thanks, Konrad
You can access the project files by right clicking the project in the solution and selecting "Unload Project" then right click on it again and select "Edit MyProject.csproj". To open the project again, right click and select "Reload Project".

visual studio cant see new project from existing code

I cant see this command in file menu. File->New->Project from existing files ...
there isnt it.
how can i customise visual studio to see it ?
thanks for help
I presume you have Visual Studio 2010 professionnal and above...
I see two options to bring back that menu!
Reset your settings
Customize the File menu to add up the missing command (See To add a command to a menu or oolbar.
To make a project from existing source files: if you do not have a project for them yet you need to first make a new project. This will automatically make a ProjectName.CS file; you can simply delete this file in the Solution Explorer. Then right-click on the project folder, and choose "Add...." -> "Existing item", and choose the file or files you already have.
To add an existing project to your solution, right click on the solution in the solution explorer, select Add -> Existing Project....
If this isn't what you are asking, please clarify your question. What exactly are you trying to do?

Undo VS 'Exclude from project'?

Is there a way to undo the 'exclude from project' operation in Visual Studio (2008) ?
How to include files back into the project after excluding them?
Make sure you are showing all files. There is a button at the top of the Solution Explorer called "Show All Files". To see this button, make sure that your project is selected in the solution explorer.
Show All Files
When this option is active, the file should be there, just grayed out. Right click it, and select "Include In Project".
Include In Project
Visual Studio Express 2012
Select Your Project Folder Click On "Show All Files" icon to show all Excluded Folders And Files
Then Right Click on Excluded Folder or File and Click on "Include In Project"
In the absence of an actual undo option you could select Add > Existing Item... to re-add the item you've just excluded.
I couldn't find the "Show All Files" button in Visual Studio 10 when I ran into this problem.
Another way to solve it is to open the containing folder in Windows Explorer by right clicking the folder in Solution Explorer and selecting "Open Folder In Windows Explorer".
Find the folder you want to add back into the project and Drag/Drop it from the Explorer window into your Solution Explorer in Visual Studio.
Add existing will not work if it is a folder that you excluded.

Resources