Tuesday, 27 October 2015
Install windows service using Command Prompt C#,Asp.Net
First of all check your System type : 32-bit or 64-bit.
Open Command Prompt in Administrative mode.
Open C:\ drive
Choose Windows > Microsoft.NET > Framework64 > v4.0.30319
If you are using 32-bit OS choose Framework folder only otherwise choose Framework64
and finally path like this:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319
after completing these steps copy the path from address bar and then open command prompt type
cd copied path
ex: cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319
Press Enter key.
For Installation:
type installutil exe file path
ex: installutil E:\E\Final\abc\bin\Debug\job.exe and the press enter
or
installutil /i "E:\E\Final\abc\bin\Debug\job.exe"
displays a message if successfully installed otherwise throw error message.
For UnInstallation:
If you want to uninstall service just add -u at the end of the path
installutil E:\E\Final\abc\bin\Debug\job.exe -u
or
installutil /u "E:\E\Final\abc\bin\Debug\job.exe"
Sometimes below errors happen:
An exception of type 'System.TypeInitializationException' occurred in service.exe but was not handled in user code
Solution: Check connection string properly what you have used in your code.
Open Command Prompt in Administrative mode.
Open C:\ drive
Choose Windows > Microsoft.NET > Framework64 > v4.0.30319
If you are using 32-bit OS choose Framework folder only otherwise choose Framework64
and finally path like this:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319
after completing these steps copy the path from address bar and then open command prompt type
cd copied path
ex: cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319
Press Enter key.
For Installation:
type installutil exe file path
ex: installutil E:\E\Final\abc\bin\Debug\job.exe and the press enter
or
installutil /i "E:\E\Final\abc\bin\Debug\job.exe"
displays a message if successfully installed otherwise throw error message.
For UnInstallation:
If you want to uninstall service just add -u at the end of the path
installutil E:\E\Final\abc\bin\Debug\job.exe -u
or
installutil /u "E:\E\Final\abc\bin\Debug\job.exe"
Sometimes below errors happen:
An exception of type 'System.TypeInitializationException' occurred in service.exe but was not handled in user code
Solution: Check connection string properly what you have used in your code.
Thank you for Visiting
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment