My job forces me to work in Visual Studio and .NET. I'm attempting to streamline the experience, somewhat successfully. (TFS still thwarts me.)
Right now, I want to work with multiple Solution Explorers, as we have a Visual Studio solution containing a multitude of csproj files. Creating a new Solution Explorer view for each commonly-used project would be great, except for this - all of the tabs and titles say "Solution Explorer".
Is there any way to change the title of the Solution Explorer window and tab? Is there any way to set the title to the title of the root solution or project file? (If there's an extension that will do this, I will happily install it.)
Thank you.
Edit: It looks like my question wasn't understood very well. The project conforms to regular standards - it's one Solution with multiple Projects, with a highly-nested directory structure. Basically, instead of having to scroll a lot, and constantly open and close nodes in the tree view, I'd like to have multiple Solution Windows to help facilitate this. Visual Studio provides an option called New Solution Explorer View in the context menu, which will open a new Solution Explorer window with a target object at its root. I want to do this for the commonly-used projects in my solution, but I want each Explorer instance to be named so that I can keep them in a single pane and click between them. Make sense?
Hope I've appeased the VS enthusiasts.
Double Edit: This is the feature I'm looking for. Is this possible through an extension?
There exists a visual studio-extension named Multiple Solution Explorer Tools, which extends the default behavior of the New Solution Explorer View-command:
Multiple Solution Explorer Tools Visual Studio Extension
New Solution Explorer instances gets persisted across solution unload and load.
The toolbar provides an icon () to rename the current solution explorer view.
The extension currently supports Visual Studio 2017 and 2019.
Related
I'm trying to create a Visual Studio 2017 extension, just for fun and to learn how VS extensibility works.
My extension must be usable from the Solution Explorer tab as a context menu button, but I would like to include it at a menu level that isn't root.
My goal is to put it in the "Add" sub-menu, but at the moment I'm only able to put it at root level (when you right-click the Project item, the menu entry is shown as the last of the context menu control).
How can I move it under the "Add" node?
Can it be done from the CommandPlacement tags I have configured in my .vsct file?
Use as parent of your command the IDG_VS_CTXT_PROJECT_ADD_ITEMS group id. If you are using CommandPlacement it would be:
<CommandPlacement guid="..." id="..." priority="0x0001" >
<Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_PROJECT_ADD_ITEMS"/>
</CommandPlacement>
Remember:
The parent of a group can be another group, a menu, a toolbar, a context menu, etc. either created by your extension or an existing one of VS, identified by prefix "IDM_". See GUIDs and IDs of Visual Studio menus and GUIDs and IDs of Visual Studio toolbars.
The parent of a command is always a group, never a menu, context menu or toolbar. The group can be new (created by your extension) or an existing group of Visual Studio, identified by prefix "IDG_". You have some built-in Visual Studio groups in the links above, but for a more exhaustive list install the ExtensionTools extension (Mads Kristensen) that provides intellisense in the .vsct file or check the source code of its VsctBuiltInCache.cs file.
I think and hope this might help, though it is a general answer and not a specific one. Learn by example.
I also hope the WiX authors won't mind, but I believe the source for their Visual Studio integration component "WiX Votive" is here: https://github.com/wixtoolset/VisualStudioExtension.
There is also this: https://github.com/wixtoolset/VisualStudio.wixext. I am not sure what this is to be honest. I should, but I don't. Mr.Arnson - I summon theee (WiX developer - The Matrix's got you).
WiX Votive - VS Integration is part of the overall WiX Toolset - which is a Windows Installer deployment solution capable of compiling MSI files from XML markup. MSI files are the binary deployment files used by Windows Installer for deployment on Windows.
If of interest you 1) download and install WiX itself (currently 3.11.1), and 2) download and install the correct Visual Studio integration (the marketplace links underneath the main download) making sure you get the correct version for your Visual Studio version - of course. Both downloads from the same link (or use the Visual Studio marketplace).
Here are some further details: WiX quick-overview.
I have setup an class library project in visual studio so I can make a custom hyperlink [the built in one doesn't have what i need]. I want to now make a demo project to test it but I want to be able to do it without having to create a whole new project. How can I do that?
For what you want you just need to create a new project in the same solution.
If the solution is not seen in the Solution Explorer, you can enable the option to always show it here:
Open the Tools menu.
Press the Options item.
Expand the Projects and Solutions tree node and select the General tree node.
Tick the Always show solution check box.
Now you can just right-click your solution in the Solution Explorer and press Add and New project.
MSDN Reference to adding projects to a solution: https://msdn.microsoft.com/en-us/library/ff460187(v=vs.100).aspx
Whenever you create almost any type of new project in Visual Studio, a Solution is created for you;
A Solution is a structure for organizing projects in Visual Studio...
This means that multiple Projects (and Projects of different types) can exist within a single Solution. You can see the link above for steps on how to do this, or you can follow the steps listed below:
Open Solution Explorer from the View menu in Visual Studio [if it isn't already open];
Right-click the Solution in Solution Explorer. The Solution, as far as I am aware, is always the first item in the list;
Navigate to Add > New Project...:
;
Follow the steps to create your desired Project;
And that's it.
Don't forget to right-click the new Project in Solution Explorer and select Set as StartUp Project if you want to Run or Debug it:
I have an ASP.NET MVC4 application solution (.sln). When I close Visual Studio and then reopen it and my solution, my tabs and my navigation structure in the solution explorer do not restore to the way they were.
The solution is big and it takes me a long time to reopen many tabs and open lots of folders in the solution explorer.
Is there an option in VS that would allow me to restore the solution to where it was when I left it?
I've already done "Reset all settings" in the Import and Export Settings Wizard, but it didn't help.
I've also tried booting VS in /SafeMode which disables any extensions. No difference.
Searching around I can't see anyone have similar issues.
As far as I know the .suo-File saves which files are opened. Try to delete this file (VS will generate it new) and make sure that windows-file-permissions are set correct (read, write access).
I had the same problem with Visual Studio 2013, and I solved it by doing this:
Export my current settings, making sure to UNMARK General Settings > Window Layouts.
Re-import the settings I just exported, but making sure I left General Settings > Window Layouts MARKED now (so it would overwrite the current Window Layouts with the "clean slate" of the imported settings.
Perhaps you can try the Workspace Reloader plugin that Scott Hanselman blogged about?
http://www.hanselman.com/blog/IntroducingWorkspaceReloaderAVisualStudioAddInToSaveYourOpenFilesAcrossProjectReloads.aspx
You can install it from here - http://visualstudiogallery.msdn.microsoft.com/6705affd-ca37-4445-9693-f3d680c92f38
Got this issue also for Microsoft Visual Studio 2022 Community Edition.
How to fix :
First, be sure, that tools->Project and solutions->General:'Reopen documents on solution load' and 'Restore Solution Explorer project hierarchy state on solution load' enabled
Second, just close VS and delete .vs folder, then re-start VS.
Works fine for me
I wrote an application in Visual Studio C# 2010, that I would like to import into another existing Visual Studio C# 2010 Application. How would I go about doing this?
For instance, I'd like to import the project into another, and basically copy/paste the interface from the application into a tabpage on a tab control I have.
Any assistance or advice on how to do this is greatly appreciated!
You should be able to copy the physical files using windows from the existing solution location to the new solution location.
Then once the copy is complete open Visual studio and tell it you want to add an existing project. Navigate to the folder where the files are on the filesystem and open the project file.
Once you save the solution it should from that point forward have the new projects in the new solution.
There are several ways to achieve this - Copy & Paste being one of them (but the least beautiful of course). A more promising one is the following:
Wrap the user interface you want to share in a User Control in the existing project. Also include the code behind logic in this user control. Include the user control in the project and make sure that everything works before continuing.
Add the existing project to the new solution. It is advised that you create a hierarchical structure in the file system for the solution so that all projects in the solution are located under a directory.
Reference the project from the project that wants to access the user interface. As the projects are in the same solution, you can add a project reference. This asserts that the projects are built together.
Place the user control on the tab page.
As an alternative, you can also pass on adding the project to the solution but only create a user control and add a binary reference from the other project.
Do you know an add-in for visual studio which adds properties for C# projects?
csproj file format is very powerful but only small amount of options can be changed through the standard properties page. For instance, I want to have several configurations and each of them should include it's own references. Or I just want to change the type of project from winforms to wpf or other one. In order to do stuff like that developer has to edit csproj by hands in text editor instead of using properties.
If you know that such add-in doesn't exist, do you think that it could be popular on codeplex? or only small amount of developers realy need it? what is your opinion?
How is it going?
To edit project files inside of Visual Studio I use PowerCommands, but those things you can change "using properties" are those in Project Menu -> [Project Name] Properties. What PowerCommands does (among other things...) is allow you to easily edit the XML of a project opened inside Visual Studio so you get all the benefits of using Visual Studio to edit XML. Makes sense?
XML is hierarchical, so hardly you can fit it comfortably on a property list better than on a text editor.
About "I want to have several configurations and each of them should include it's own references", try creating templates for your projects, take a look there: Visual Studio Templates.
So... you are looking for addins at codeplex? why not take a look at http://visualstudiogallery.msdn.microsoft.com there are free and paid addins, an some form codeplex too. While you are on it, look for "Productivity Power Tools", "VSCommands 2010", "AllMargins" and "VS10x Code Map". I use them all, and they are certainly worth a look. [Hmmm... I also use CodeRush, you can get CodeRush Xpress for free from http://www.devexpress.com ;)]
Hope of being of help.
A little late to the table but I wanted to remove VSCommands 2010 because all I use it for really is the edit project file and I don't like to just have extensions hanging around if I am not using them. I discovered from this blog:
http://blogs.msdn.com/b/habibh/archive/2009/07/01/the-quickest-way-to-edit-a-visual-studio-project-file.aspx
"There is a quick and easy way of editing your Visual Studio project file. When a project is "unloaded", either because you explicitly chose to unload the project using the "Unload Project" command or Visual Studio failed to load the project for some reason (e.g. project upgrade failed), you can right click on the project in Solution Explorer and select the "Edit " command, as shown below."
It works like a charm!