My application is intended only for me and my colleagues, so I donโt care if it is Click-Once or copy-the-exe. I want to be able to click on a file with a given extension in Windows Explorer and run my program and open this file. I can not get it to capture the file name.
Poison Solution:
http://blogs.msdn.com/b/avip/archive/2008/10/27/wpf-supporting-command-line-arguments-and-file-extensions.aspx
The code I'm trying to do below, and at this point all I am trying to do is put the name of the clicked file in the text box. I suspect that my corresponding ignorance is how to reference a one-time application from a Windows browser. When I create, I get a file called setup.exe, the Wis.application file, and when I click "setup" to install it, I get a shortcut like "Click-once application link" in "C: \ Users \ ptom \ AppData \ Roaming \ Microsoft \ Windows \ Start Menu \ Programs \ Wis ". I tried to link files with this shortcut created during installation and link files with setup.exe. When I click on the file, the application launches, but indicates that AppDomain.CurrentDomain.SetupInformation.ActivationArguments is null. (By "indicates" I mean that the text field is filled with the text from which I am testing to see if it is null). If I run the application from debugging or just run it from the start menu, it will do what I expect, following the code path that indicates that ActivationArguments is not null, but its ActivationData value (string []) is 0 in length.
Here is the code from app.xaml.cs
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Linq; using System.Windows; namespace Wis {
thanks
source share