How to change TargetExt through visual studio UI - visual-studio-2010

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.

Related

Rename form and all instances of form in 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.

Visual Studio context menu/toolbar Set StartUp Projects

I am hoping to put a toolbar button (or configure a keyboard shortcut) for the Set StartUp Projects... solution context menu item.
If the solution is selected in Solution Explorer the Project menu has solution context items, but I cannot seem to find this command anywhere. I can only find single Set as StartUp Project and similar.
Does anyone know if I can do this?
EDIT: I found this extension which allows me to do what I want quite easily (define different combinations of start up projects): https://visualstudiogallery.msdn.microsoft.com/f4e1be8c-b2dd-4dec-b273-dd88f8818571
It is the one command Project.SetasStartUpProject that works differently depending on whether a project or the solution is selected in Solution Explorer. To select the solution and then call Project.SetasStartUpProject you can probably use Visual Commander or Macros for Visual Studio 2013.
This extension does exactly what I required. It has linked versions for other editions of VS. It uses json config files to start multiple projects nicely.

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?

Is there a visual studio automatic save configuration setting?

I use the java IDE IntelliJ IDEA and one of the features I like is that there's no saving. Everything's always saved and you just use history navigation. I tend to have both editors open and I'm always forgetting to save in VS.
I'm running vs 2008 with resharper 4.5 but as far as I can tell this isn't achievable or configurable.
Any suggestions?
For VS 2019, the Auto Save File extension seems to work as expected.
It saves individual files on lost focus, can save all files when VS loses focus and can also save all after an inactivity delay.
In VS 2015, I used to use NoMorePanicSave2015.
It does an equivalent of Ctrl+Shift+S when Visual Studio loses focus, which saves all your files, including solution and projects.
Another plugin: CBAutoSave
This extension can automatically save modified documents, projects, and the solution whenever Visual Studio loses focus.
Saving of modified documents is on by default, while automatically saving projects and the solution is not. All options are configurable through the Visual Studio options dialog.
In VS2017/19 Community there is Auto-Recover option under tools->options->autorecover. It will not autosave unless there is a crash, so it may be a good compromise.
In VS2019 its under tools->Options->Environment-AutoRecover.
how-to-auto-save-work-on-visual-studio
Visual Studio 2008 will probably be the same:
http://www.howtogeek.com/howto/programming/configure-autosave-autorecovery-of-crashed-projects-in-visual-studio-2005/
However, it's not "no saving" but you can set it down to 1 minute.
Visual Studio 17.2 can now automatically save code documents whenever the application loses focus. This feature can be accessed via Tools > Options > Environment > Document.
There is an autosave, but I must admit that it doesn't seem to always work for me - notably I suspect that it only saves files, but not projects/solutions, or the .user and .suo files. I don't have any links to prove this mind you.
Visual Studio 2022 (Enterprise) has auto save option. But you have to enable it.
Navigate from Tools > Options > Environment > Preview Features and Enable the autosave.
here is a screenshot

Windows Explorer - Dynamic Icons For Same File Extensions

For Visual Studio .sln files, Window Explorer is doing something "clever" to figure out whether to display the v8 or v9 icons.
Now when it comes to double-clicking/launching the icon, I know that it goes through a "Visual Studio Launcher" app which looks at the version info in the sln file and selectively runs VS2005 or VS2008
But any idea how it does the icon part. Presumably that simply by browsing to a folder, something is opening the file in the background and making a decision on which Icon to use, but its so seamless/quick.
Any idea how it's done. We have config generator here, that gets updated deployed by ClickOnce but it would be nice for people to see at a glance which version of the generator app, created the config files.
Cheers,
I think this is what you're looking for?
How to Create Icon Handlers
Take a look at this part of a tutorial to shell extensions on custom icons.

Resources