How to show a file when opening a Visual Studio solution

I need to add a C # solution with examples to be distributed as part of the software library installer. This solution will have various examples of using the product API.

I want to be able to display a simple quickstart file explaining how to run the examples when the solution opens in Visual Studio.

Is there a way to tell Visual Studio to open a specific text file when opening a solution / project?

+1


source to share


4 answers


It looks like a solution or project template would be the best option. This will allow you to create an entry in the File - New dialog box (similar to New Class Library, etc.). In VS 2008 they are easier to create - File → Export Template. A template is just a zip of a project with an xml manifest file that you can modify. Part of the manifest schema allows you to specify files to open as HTML or text. Templates can be installed relatively easily as part of an installer package.

There's more about the general concept here: http://msdn.microsoft.com/en-us/library/6db0hwky.aspx



And a schematic link on how to open files in different modes at startup: http://msdn.microsoft.com/en-us/library/ys81cc94.aspx

If you need to provide more instructions / wizards, consider the Automation Automation Toolkit.

+1


source


What will be said.



The state of the solution UI (for example, which files are open for editing) is stored in one of the solution files, for which it is assumed that there should be a separate copy for each user, and therefore, as a rule, it is not included in general version control: i.e. ... not a * .sln file, but instead I consider a * .suo file (but be careful, this is a binary file that won't "merge").

+1


source


I don't think the solution file can actually open certain content or even a script.

Perhaps you could create an MSI customization for your library (if you haven't already) and not deliver a solution with sample code, but a project template installed by the MSI in the right place to be instantly available as a template in VisualStudio? Then someone can easily do a New Project, select a demo template, and have a pre-installed project with your sample code.

+1


source


Just create a .bat file (using VS env) with the one that calls devenv / useenv yoursolution.sln - this way you can make things a little weird if you want;)

0


source







All Articles