How to associate a file extension to the current executable in C#

后端 未结 9 2222
故里飘歌
故里飘歌 2020-11-22 12:01

I\'d like to to associate a file extension to the current executable in C#. This way when the user clicks on the file afterwards in explorer, it\'ll run my executable with t

9条回答
  •  一生所求
    2020-11-22 12:57

    If you use ClickOnce deployment, this is all handled for you (at least, in VS2008 SP1); simply:

    • Project Properties
    • Publish
    • Options
    • File Associatons
    • (add whatever you need)

    (note that it must be full-trust, target .NET 3.5, and be set for offline usage)

    See also MSDN: How to: Create File Associations For a ClickOnce Application

提交回复
热议问题