I have a problem when I try to Run published Application. When I Run Release or Debug Version from VS (key F5) everything work well. So I try to publish my application (no problem). After this I Installed application by oneClick installer. Instalation was finished without problem, but when I try to run this installed application, I only see message: Program has Stop Working.
Please, does anybody know where should be a problem? It´s really wierd, I suppose, when the application run correctly from VS, then it Should run after installing to!? Or am I wrong?
Or is there some option to reset Publish settings in Visual Studio?
Thanks a lot!!!
It depends how you have ClickOnce setup, but the main reason this happens is the ClickOnce system encounters an error while checking for updates or running the .application from the remote location.
It should give you the option to see a log of the problem (or at least the nasty temp file it threw it in).
From here you can determine the problem ClickOnce is having.
Most Common Problems I would Suspect:
The User's having trouble communicating thier auth token / credentials to the web server the ClickOnce app is on.
There's another web-related issue downloading the app manifest or .application from the server
Group / Local Policy Problems
Broken install in on local machine's ClickOnce somewhere causing it to have problems overwriting on disk or finding an appropriate location to setup the clickonce package.
Broken install in on local machine's ClickOnce causing a GUID Conflict (I.e. your app and the broken install can't be upgraded, but share the same GUID)
Antivirus / Firewall blocking access to the web component from the executable clickonce deploy.
These are all the problems I've encountered with ClickOnce and the reasons we've primarily moved away from it to a Wix style installer.
Related
I am trying to use ClickOnce to automatically update a C# software.
I can publish my application, the setup.exe is created, but when I download/run it, windows tells me that application can be dangerous, the publisher cannot be verified. And if I choose to run it anyway, or as administrator, the install dialog sometimes appear after 10 min but in general nothing happen.
I tried to find a way to make my application trustful but even if :
I enable ClickOnce security settings
Select "This is a full trust application" in "Security"
Add a certificate in "Signing"
It is still not working, so I have no more idea about how to fix this.
I can install it with the ".application" file but I think that is not the correct way to do it.
Thanks by advance !
You are pretty close. Much of the slowness is probably because of anti-virus. Signing it will make things better. The client machines will complain about how trustworthy the app is, unless you install your key (the one used for signing) on each of their machines.
Installing with the ".application" is just fine, especially if you are installing from a network share (instead of a web site or intranet site). That should put an app (icon) in the users' start menu.
I have developed a windows service on my system and have deployed the service on a target machine which does not have visual studio. Therefore, I need to debug the application from my PC. I already know how to debug a windows service on a local machine.
MY STEPS:
Copied the complete bin folder (containing .exe as well as .pdb files) to the target machine.
Installed the service on the target machine using InstallUtil.exe (i.e installUtil.exe "pathToMyServiceEXE/myService.Exe")
Started the service
Installed Visual Studio Remote Debugging application (started in "No Authentication mode" with Debugging option checked)
Attached to the service in Visual Studio (which is running on my PC)
PROBLEM: I am able to successfully attached to the windows service of the target machine. But it cannot find the symbols.
I have checked other SO questions about the same problem but could not find the correct solution so far. I have tried the following things to solve the problem:
Opened Tools->Options->Debugging->Symbols and then put the path of .pdb files on my local PC. (Didn't work)
Opened Tools->Options->Debugging->General and unchecked "Enable just my code".
In addition to above two, I have already made sure that I am running the x64 version of the Remote debugging tool, Debug/x64 version of windows service and debug/x64 on my local PC.
The best advice that I can give you - which is not the easiest now, but will pay off in the long run - is to use WinDBG debugger on the target machine. This is next to zero setup on the target machine but will require you to learn the basics of WinDBG. This is not trivial but will pay off in the long run.
Regarding why you cannot load symbols:
Maybe PDBs do not match binaries?
Maybe path is not accesible to the current logged-in user? (such as mapped drive, etc)
Maybe permission issue?
Other then that I think it should work
There is a weird issue I am facing. I created my first windows service looking through various blogs and tutorials.
Then created setup for that adding installer etc. It works fine while installing , un-installing via Visual Studio but it fails when i deploy it .
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\Users\bhuvint\Documents\Visual Studio 2010\Projects\CPNS Library\ServicePackage\CommonPushNotificationWindowsService.application resulted in exception. Following failure messages were detected:
+ You cannot start application CommonPushNotificationWindowsService from this location because it is already installed from a different location.
+ You cannot start application CommonPushNotificationWindowsService from location file:///C:/Users/bhuvint/Documents/Visual%20Studio%202010/Projects/CPNS%20Library/ServicePackage/CommonPushNotificationWindowsService.application it is already installed from location file:///C:/inetpub/wwwroot/ServicePackage/CommonPushNotificationWindowsService.application. You can start it from location file:///C:/inetpub/wwwroot/ServicePackage/CommonPushNotificationWindowsService.application or you can uninstall it and reinstall it from location file:///C:/Users/bhuvint/Documents/Visual%20Studio%202010/Projects/CPNS%20Library/ServicePackage/CommonPushNotificationWindowsService.application.
I have already un-installed the service and trying to install it from the deployed service in the same pc to test. But it fails with above error.
I feel i have deployed the windows service the wrong way. Could you guys please suggest how to deploy a windows service ?? (I have looked through net. All suggest building it and installing it from visual studios. But how to publish it is the thing which i need.)
Please help asap.
Possibly you built the setup project before uninstalling the preovious service. In that case you can't use the new setup to uninstall the service, since the setup won't be the same and can't be able to access the service installed.
You should try to go to a previous version of your project and uninstall the service and for the future unistall the service each time you're building your setup project.
This happened to me several times.
Run visual studio in debug mode, and in your properties of your service project goto tab build events in Post-Build event command line and add a -d so you can run your service without installing it, it will run as an console app
The LocalService account acts as a non-privileged user on the local computer, and presents anonymous credentials to any remote server. Use the other accounts with caution, as they run with higher privileges and increase your risk of attacks from malicious code.
If your service application will not install correctly, check to make sure that the ServiceName property for the service class is set to the same value as is shown in the installer for that service. The value must be the same in both instances in order for your service to install correctly.
NoteNote
You can also look at the installation logs to get feedback on the installation process.
You should also check to determine whether you have another service with the same name already installed. Service names must be unique for installation to succeed.
STUPIDITY PERSONIFIED
As i told i was deploying my service. So this published code had a "setup.exe" file to it. Now I had already created a setup project for the windows service , which i was using for the installing , uninstalling . And i din't know (These words needs courage !!) that msi file created is required to install the windows service. So as i got through the folder structure of the setup project. I came across the .msi file . And hence the problem got solved. The Main problem was :
Me not knowing to use setup projects
And I confused setup.exe with the published windows service with the setup of windows service.
I am really sorry for stealing bandwidth off your precious time. Thanks to all for the valuable inputs.
I would really appreciate any help as to why i get a system.io.filenotfoundexception message when i double click the setup.exe on the production server's desktop after installing the app from a CD. I had earlier deployed the winforms app using VS2010 ClickOnce tool, on the Development server (WinVista) to a CD, then ran the CD on the prod server and installed the app to the prod server.
What could be the missing required file(s), or were the files installed in the wrong location/directory??
Or have i missed out something/done the wrong thing while setting the configs in ClickOnce?
What is the installation URL that was used when the C/O application was published? Did you check the box that says you are deploying to a CD?
Do you have an update URL or an installation URL that the application can use to get updates, or are you only providing changes via CD?
If you are not going to provide updates via a file share or web server, I would have the deployment NOT include a deployment provider URL in the deployment (there's a checkbox in the publishing options). Then it will set it to the CD drive when it installs, and look there for updates when the user runs it.
is the setup.exe executed as administrator ?
check how resources are used, f.e images in resouces - do they have "embedded Resource/linked at compiletime" or "copy to outup" activated ?
I have been working on an application using .NET 4 and c# in Visual Studio 2010 Express. It's purpose is to watch a directory and import any documents it finds into our imaging system.
I included an installer class which provides the information needed by installutil.exe.
So to install locally, I build the solution, and then at command line:
installutil.exe MyProjectExecutable.exe
Which installs it as a service. This works fine in my development environment.
To deploy to the test environment, I use the same method:
installutil.exe MyProjectExecutable.exe.deploy
Except of course the executable has a second extension, .deploy. This is the way the application is published by Visual Studio. Everything works up tot his point
Here is the problem: once I have done this, I run the service and it starts properly, as indicated in the log file. However, once it detects files in the directory, the service will not do anything with them and will eventually crash. The only way I can tell it has crashed is to look in the windows Event Viewer. It will show the message:
"An unhandled win32 exception occurred in MyProjectExecutable.exe.deploy [4108]. Just-In-Time debugging this exception failed with the following error: Debugger could not be started because no user is logged on."
Two questions:
1) What could be causing this
2) Am I going through the correct steps to install a windows service, or is there a better way?
Both environments have .NET 4 installed.
In both environments I am placing the same documents in the import directory.
In both environments the service runs under the Local System account.
If my question reflects a lack of C# experience, my apologies in advance.
subscribe to AppDomain.UnhandledException Event
Are you watching a directory under 'Documents and Settings?' You mention that you're running under Local System, but is that in the C# code or in the Services Panel?
Start->Run
services.msc
< Find your App >
Right-click, Properties
Log On Tab
Log On As
This Account
< Plug in a user / pass with permissions >
In my experience this it is always a security problem. Check the rights that the service running user has. Can it access the folders you are monitoring and make the needed changes?
I have found the problem. in the config file, the listen directory was "c" whereas it should have been "C". Until now, I didn't think Windows was case-sensitive. Thanks for the help guys.