Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Question

Post Timeline

deleted 25 characters in body
Source Link
marc_s
  • 760.3k
  • 186
  • 1.4k
  • 1.5k

I have a WinFormsWinforms application published using ClickOnceClickOnce. I want users to be able to right-click a file in Windows Explorer and select "Send To → Crawler""Send To → Crawler", which should then launch my ClickOnce app and pass the selected file path as an argument.

To do this, I created a shortcut in the SendTo folder that points to the ClickOnce .appref-ms file:

string sendToPath = Environment.GetFolderPath(Environment.SpecialFolder.SendTo);
string shortcutPath = Path.Combine(sendToPath, "Crawler.lnk");
string clickOnceAppPath = Path.Combine(
 Environment.GetFolderPath(Environment.SpecialFolder.Programs),
 "Crawler",
 "Crawler.appref-ms"
);
CreateShortcut(shortcutPath, clickOnceAppPath);

The shortcut does get createddoes get created, and double-clicking it directly works fine. However, it doesn’t appear in the actual "Send To" context menudoesn't appear in the actual "Send To" context menu, or doesn’t work as expected when a file is sent through itdoesn't work as expected when a file is sent to it.

I have a WinForms application published using ClickOnce. I want users to be able to right-click a file in Windows Explorer and select "Send To → Crawler", which should then launch my ClickOnce app and pass the selected file path as an argument.

To do this, I created a shortcut in the SendTo folder that points to the ClickOnce .appref-ms file:

string sendToPath = Environment.GetFolderPath(Environment.SpecialFolder.SendTo);
string shortcutPath = Path.Combine(sendToPath, "Crawler.lnk");
string clickOnceAppPath = Path.Combine(
 Environment.GetFolderPath(Environment.SpecialFolder.Programs),
 "Crawler",
 "Crawler.appref-ms"
);
CreateShortcut(shortcutPath, clickOnceAppPath);

The shortcut does get created, and double-clicking it directly works fine. However, it doesn’t appear in the actual "Send To" context menu, or doesn’t work as expected when a file is sent through it.

I have a Winforms application published using ClickOnce. I want users to be able to right-click a file in Windows Explorer and select "Send To → Crawler", which should then launch my ClickOnce app and pass the selected file path as an argument.

To do this, I created a shortcut in the SendTo folder that points to the ClickOnce .appref-ms file:

string sendToPath = Environment.GetFolderPath(Environment.SpecialFolder.SendTo);
string shortcutPath = Path.Combine(sendToPath, "Crawler.lnk");
string clickOnceAppPath = Path.Combine(
 Environment.GetFolderPath(Environment.SpecialFolder.Programs),
 "Crawler",
 "Crawler.appref-ms"
);
CreateShortcut(shortcutPath, clickOnceAppPath);

The shortcut does get created, and double-clicking it directly works fine. However, it doesn't appear in the actual "Send To" context menu, or doesn't work as expected when a file is sent to it.

Source Link

ClickOnce App Doesn't Launch from "Send To" Shortcut

I have a WinForms application published using ClickOnce. I want users to be able to right-click a file in Windows Explorer and select "Send To → Crawler", which should then launch my ClickOnce app and pass the selected file path as an argument.

To do this, I created a shortcut in the SendTo folder that points to the ClickOnce .appref-ms file:

string sendToPath = Environment.GetFolderPath(Environment.SpecialFolder.SendTo);
string shortcutPath = Path.Combine(sendToPath, "Crawler.lnk");
string clickOnceAppPath = Path.Combine(
 Environment.GetFolderPath(Environment.SpecialFolder.Programs),
 "Crawler",
 "Crawler.appref-ms"
);
CreateShortcut(shortcutPath, clickOnceAppPath);

The shortcut does get created, and double-clicking it directly works fine. However, it doesn’t appear in the actual "Send To" context menu, or doesn’t work as expected when a file is sent through it.

default

AltStyle によって変換されたページ (->オリジナル) /