O'Reilly logo

Microsoft® Visual Basic® .NET Programmer's Cookbook by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Associate a File Extension with Your Application

Problem

You want to register your application to open automatically when the user selects certain file types in Windows Explorer.

Solution

Use the File Types Designer to configure a setup project accordingly.

Discussion

You can register file types by modifying the registry manually using the techniques explained in recipe Access the Registry. However, a much better approach is to make these configurations once—at installation time—using the features built in to the Visual Studio .NET setup project.

To use this approach, begin by creating a setup project as described in recipe Create a Windows Installer Setup Project. Then follow these steps:

  1. Right-click your setup project in Solution Explorer, and select ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required