问题
Wondered if this has ever happened to anyone out there. I have a WPF application that I publish using ClickOnce.
When the ClickOnce link is reached I click "Run" and the app is installed on my machine. However, when I click the application from the start menu, it checks for updates, then does nothing.
Am I missing a setting?
回答1:
It sounds like you the application is exiting on it's own after startup. Either by means of explicitly exiting or because of an unhanded exception.
Have you tried attaching a debugger and seeing what is happening?
回答2:
There's a few things you do.
To check whether there is an unhandled exception you can:
- Attach a Dispatcher Exception Handler on your System.Windows.Application object.
- Listen to the UnhandledException event on the AppDomain.
In these you can catch any unhandled exceptions, log them and figure things out.
Another technique that we use to attach a debugger is that we have a piece of code in our initialization logic that says that if the CTRL key is pressed, a little message box pops up before anything occurs in the app with the text "starting up". This is our chance to attach a debugger and figure things out.
回答3:
There is a known problem of this happening when the user has a Kensington mouse, or at least the Kensington mouse software installed.
回答4:
Put a call to System.Diagnostics.Debugger.Break(); in Main()
run with click once from your Website, just step over the breat point when you hit it then exit your app
start your app from start menu
debug it when you break point is hit (windows will ask if you wish to debug the app)
回答5:
I had the same problem. VS 2010.
I did a few things:
- Project Properties -> Publish tab -> "Options..." -> "Description" -> "Publish language" = (Default).
- Project Properties -> Publish tab -> Wipe all underscores ("_") and space-characters (" ") from publish paths
- Wipe all underscores ("_") and space-characters (" ") from project name, project path, solution name, solution path
- Project Properties -> ApplicationTab -> Wipe all "_" and space (" ") from assembly name and default namespace
- Project Properties -> ApplicationTab -> Assembly Information -> Neutral language = (none)
- Project Properties -> Signing -> Unchecked both options
- Project Properties -> Security -> Checked "Enable Click Once Security settings" with radio "this is a full trust application"
Now its working like a charm.
来源:https://stackoverflow.com/questions/1241885/wpf-clickonce-installs-but-nothing-happens