How to clear User's Programs Menu folder? - visual-studio

I am trying to create an setup project in visual studio 2010 that clears an existing applications program menu. After running the installer that I am creating, the installer duplicated already existing short cuts in the programs menu. I would like to be able to remove all the existing short cuts from a specific programs menu folder and just have the new short cuts appear.

Right click on Deployment project, select properties and set the "RemovePreviousVersion" property to true..

Related

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.

Visual Studio Installer how to prompt for install of shortcuts

I am using the basic VS project of Other Project Types\Setup and Deployment\Visual Studio Installer\ Setup Project.
I want to give the user the option of whether or not to create a desktop shortcut to the application. I know how to create a desktop shortcut, but not to make it optional. So far I have not made any custom dialogs for the install, just using the standard interface that VS provided automatically.
Is there any way to provide the user the choice without getting into a whole bunch of customization?
Are many people using this installer? I look around, we have a 5 year old license to InstallShield, but I have also found it to be bulky and more than we need for this application.
I also looked at WiX, but I don't have the time to learn an install package right now and it looks like a fair learning curve on it.
Basically our install has .NET 4.0 requirements, installs SQL Server CE, a couple other DLL's which are just copied in and populates a structure. I am not using the registry, using the preferred resources approach for that, so it is a very straightforward install.
There several ways to do it, in general… But I don't know the particular steps for Visual Studio installer project.
Create a feature which contains the Desktop shortcut. If you have feature selection tree in your installer, present this feature as yet anther option.
With another approach, you'll have to customize one of the existing dialogs or add a new one where you can show a checkbox. The checkbox changes the value of a property which, in its turn, controls the installation of component or feature for Desktop shortcut.
Yet I guess this method is not supported by Visual Studio.
See Microsoft UX guidelines on putting shortcuts on Desktop.
In most cases, it is not necessary to put a shortcut on Desktop unless your target users start your application very often.
The general approach is this:
create a custom dialog which contains a control that can condition the shortcut, for example a checkbox
create a custom action which deletes the shortcut after install
condition it with the checkbox property
This can be done in Visual Studio:
select your setup project in Solution Explorer
click User Interface Editor button on top pane in Solution Explorer
add a Checkboxes dialog under Install -> Start
customize it to contain only a checkbox that conditions your shortcut
add your shortcut deletion custom action in Custom Actions Editor page
condition it with the checkbox property
Some commercial setup authoring tools have this feature built-in.

VS2010 "Add Item" directory change

Is there any way to change the default directory Visual Studio 2010 uses when you add a source file through Add -> New Item?
Add New Item simply adds the item based on which project directory you're currently in or have selected in your Solution Explorer. If you want to change where it gets added then select the target location in the Solution Explorer first.
This behavior is obvious when right-clicking in the Solution Explorer, but it's also the same when using Project -> Add New Item....
Since my comment seems to be the actual answer, I repost:
In the toolbar of Solution Explorer, there's a button "Show all files" (or similar, I'm using the German version). This switches the view to directories, rather than filters. In this view, you can right-click on the desired target folder to add items.
This does not actually change the default directory, but since you have to click somewhere anyway to add an item, this is the easiest approach.
Note that even when only using Visual C++, I'd recommend the Productivity Power Tools extension, which comes with Solution Navigator. In C++, this is not as powerful as with .NET, but it still has several features that are useful in C++ and can fully replace Solution Explorer.
Try going to tools -> options -> Project and Solutions.
I know this post is old... but maybe someone will stumble upon it... like I did today...
I had the same "problem":
I have a dedicated directory for icons.
When I need to add an icon to the resource file, Visual studio takes me to "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE"
To fix the problem, after I "browsed" to the desired folder, I right-clicked the favorites of the "open file" dialog and selected "add current location to Favorites".
Next time you will get this dialog, you simply have to look for the folder in the favorites, and click it.

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.

Will VS 2010 display recent used project and solution in the context menu of the start menu?

Start menu in Windows 7 has a feature: a programs, pinned to the top, can show a context menu with recently used files:
alt text http://img65.imageshack.us/img65/5149/contextmenustartmenuwin.png
Will Visual Studio 2010 be able to display also recently used Projects and Solutions?
It is possible to pin solution files to the recently used file list.
First make sure you already have Visual Studio pinned to the Start Menu.
Next, drag the Solution file on to the Start Menu so that it is pinned in the main list.
Now select the the Recently Used Files button for Visual Studio so that the list is showing.
Drag the solution file from the main list into the recently used file list.
You can now remove the solution file from the main list.
Beta 1 doesn't seem to support this yet. Its easily possible by using the new Taskbar APIs and specifically the custom categories feature. I think their main problem might be that the solution files are associated with an app called VSLauncher.exe (this small app determines what version of VS to load when you launch a SLN file).
If you want to "pin" your fav solution files to any version of VS, one option this is (I currently used this with VS 2008 and 2010 Beta 1:
Open Explorer and browse to any SLN file you want to pin.
Drag it and pin on the taskbar (it will pin to VSLauncher.exe; this is okay)
Now just repeat the steps for other SLN files.
When you click on a SLN file from the above pinned program's jumplist, another instance of VS2010/VS2008 will launch. It won't show your recent projects or solutions, but atleast it allows you to pin your fav/recent solutions manually. I think you can use this for CSProj or other project files as well.

Resources