Rename form and all instances of form in Visual Studio 2010 - visual-studio-2010

I'm working on a project in Visual Studio 2010 and want to rename a form and all instances of a form via the Solution Explorer. Here is what my screen looks like:
Any ideas? I just need a quick way to rename them all at once. I know I can rename them individually but I'm trying to find an easier way so I can do it faster.

In VS, renaming the form.cs file should also rename the form's resource and designer definition file automatically. If it is not doing that then you might have changes something manually.

Related

Getting Bookmarks Programmatically in Visual Studio

I am using VS 2010 and I want to do something quite simple. Write a Macro / Add-in which will
Save the bookmarks to a file (e.g. "myfile.bookmarks")
Load bookmarks from a file.
I just cannot find any API within DTE (when writing a macro) nor can I find anything within the Microsoft.VisualStudio namespace when creating an addin.
Can someone please help?
(The one thing I want to avoid is re-creating bookmarks functionality, although I can use code from Numbered Bookmarks extension).

How to reload a property sheet in Visual Studio 2010

Is there a way to reload a property sheet that was edited outside of Visual Studio? Visual Studio doesn't detected automatically that the file was modified (like it does with project files). The only way I've found so far is to close and reopen the whole solution (but that's no good way).
Only a partial solution perhaps for your (and my) needs, but I've found it helpful to touch the .sln file. This causes Visual Studio to wig out and ask if you want to reload all the projects. Select "Yes" and then you'll notice the properties have refreshed. I make sure that my scripts which update property files also touch any related solution file(s).
Also see Is there any way to get Visual Studio to reload all projects when the .proj files have changed?

How to change TargetExt through visual studio UI

I'm building a console based app. By default it's output extension is .exe. I want to change it to .com. Presently I'm able to do it by adding <TargetExt>.com</TargetExt> in .csproj. But I'd like to know how to do this via Visual studio 2010 UI.
This isn't natively changeable in the UI. Your best option, other than what you have done, is to add a postbuild command that renames the file, but if the csproj change is working, there is probably no reason to do that.
I was looking at examples that showed you could echo $(TargetExt) in the Post-build event. So, I wondered if you could set TargetExt=.com in the Pre-build event. As it turns out, you can.

How to keep several files in a tree in Visual Studio?

When you add (for example) WPF window to your project VS creates .xaml and .xaml.cs files. However they are not displayed in a flat list in VS Explorer, rather .xaml.cs is a child file (in terms of the tree) of .xaml file.
How to organize several "custom" files into such tree? For example I have Trainer.cs file and Trainer.Builder.cs file. I would like Builder to be displayed as a child of Trainer.cs file. How to do it?
Please note: I know about folder with files, but I don't want to use it, because in such case even the "main" file is hidden and I have to unfold folder to get it.
Update
While searching for difference between VS2008 and VS2010, I found out, that my entire question is a duplicate of SO question -- there you find how to fix a fix for VS2008 to work with VS2010 :-)
Visual Studio 2010 related file nesting
This can be done by editing the registry. A guide to doing this for Visual Studio 2008 can be found here: http://blog.dotnetwise.com/2009/09/visual-studio-2008-custom-nested-files.html
You can also do this through a Visual Studio Extension, but unless this is part of a larger project this is probably overkill. There is a guide to implementing this behavior here: http://pieterderycke.wordpress.com/2011/03/10/adding-support-for-nested-files-in-custom-visual-studio-project-types-with-mpf/

Hidding source control files within Visual Studio's solution tree

We use Visual Studio 2008 and Surround SCM for source control. SCM drops files into each directory named ".MySCMServerInfo" which are user specific data files that shouldn't be checked into source control. They are similar to the .scc files dropped by Visual Source Safe. We also have several WAPs (Web Application Projects) that we develop. All these .MySCMServerInfo files show up in the solution tree and the Pending Checkins window when they should not. There has to be some way to force VS to ignore files of a given extension because it ignores .scc files. How do I get VS to ignore .MySCMServerInfo files within a WAP?
I have new information about this issue. Setting the hidden bit on .MySCMServerInfo file causes Surround SCM to loose track of the modification state for files. It starts thinking files are out-of-date when they are not, and it always attemps to get new versions.
Instead, set this registry key if you're using Visual Studio 2008:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Packages\
{8FF02D1A-C177-4ac8-A62F-88FC6EA65F57}\IgnorableFiles\.MySCMServerInfo]
Set this registry key if you're using Visual Studio 2005:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Packages\
{8FF02D1A-C177-4ac8-A62F-88FC6EA65F57}\IgnorableFiles\.MySCMServerInfo]
These will tell Visual Studio to not display .MySCMServerInfo files within the Solution tree and the Pending Checkins view.
Using the file system hidden bit should work.
Late Answer but hopefully useful to others.
I began experiencing this problem when using Visual Studio 2015 with the new ASP.Net 5 Project templates. (I presume this is because the new templates automatically include everything in the folder rather than only showing the things that are listed in the project file).
Showing these files in the Solution explorer change be prevented by right clicking the file and selecting "Hide from Solution Explorer" but this didn't prevent SCM from including them in the Pending Check-ins Window.
The correct way to deal with this problem is:
Select the file(s) in Solution Explorer
Select the File > Source Control > Exclude from Source Control
Reference
NOTE: Right Click in the Solution Explorer DOESN'T have this option.

Resources