Thursday, January 31, 2008

Finally a Supported Method to Associate a File Extension to a ClickOnce Application

Re-inventing The Wheel - How To: Add File Associations to a ClickOnce Application

"A little-known feature that made it into .NET Framework 3.5 is the ability for a ClickOnce application to be associated with document extensions. That is, once properly configured, double-clicking on a document can cause your ClickOnce application to launch. Right now, there is no direct tooling support for this feature (and if you ask me the MSDN information doesn't tell the whole story), but in this post I'll show you how you can get file associations added to your ClickOnce application.

Adding File Associations to Your ClickOnce Manifest

...

Adding File Associations through Visual Studio

There is no fancy UI to allow you to add file associations to your ClickOnce application in Visual Studio. It is also not possible to add the information to your application manifest after publishing, because that would invalidate the signature. So, does that mean you are forced to modify your manifest and then re-sign with mage after publishing?

Nope. When publishing in Visual Studio, it is possible to add a app.manifest file to your project. ...

..."

You wouldn't image the hoops I jumped through to fake out/pretend/sort-of kind-of create a file extension association to a .Net 2.0 ClickOnce app (it's ugly, but it works... ).

Now in .Net 3.5 we have official support (and it looks like it's pretty easy too). Yeah!

Just one MORE reason to move to 3.5.  :)

No comments: