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 ...

Get Microsoft® Visual Basic® .NET Programmer's Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.