The following issues occur when you deploy the win service:
You see the following error in the Event Viewer:
Journal name: Application
Source: * * * Dispatch service
Date: 2014/5/21 12:53:21
Event id:0
Task Category: None
Level: Error
Keywords: classic
User: N/A
Computer: Ams-webserver
Describe:
Service cannot be started. Achievo.Utility.DataAccess.DbException:Attempt to load Oracle client libraries threw badimageformatexception. This problem would occur when running in a bit mode with the-the-bit Oracle client components installed.
ConnectionString:
Data source=***; User id=***; password=***; Enlist=false; Pooling=true; Min Pool size=1; Max Pool size=100
CommandText:
...
Fieldnamedbtypefieldvaluefieldtype
---> System.InvalidOperationException:Attempt to load Oracle client libraries threw badimageformatexception. This problem would occur when the running in + bit mode w ...
Event Xml:
<event xmlns= "Http://schemas.microsoft.com/win/2004/08/events/event" >
<System>
<provider name= "* * * dispatch service"/>
<eventid qualifiers= "0" >0</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<timecreated systemtime= "2014-05-21t04:53:21.000000000z"/>
<EventRecordID>1334</EventRecordID>
<Channel>Application</Channel>
<Computer>ams-webserver</Computer>
<security/>
</System>
<EventData>
<data>service cannot be started. Achievo.Utility.DataAccess.DbException:Attempt to load Oracle client libraries threw badimageformatexception. This problem would occur when running in a bit mode with the-the-bit Oracle client components installed.
ConnectionString:
...
CommandText:
...
Fieldnamedbtypefieldvaluefieldtype
---> System.InvalidOperationException:Attempt to load Oracle client libraries threw badimageformatexception. This problem would occur when running in a bit mode w...</data>
</EventData>
</Event>
Solution:
This is because the machine is loaded with 64 operating systems, and this machine is loaded with a 32-bit Oracle client. So I will report such a mistake.
Many of the online search is to download what Oracle's client version, and then to use a bunch of miscellaneous configuration steps, or because of the permissions problem, to run the program with the administrator or to the win service running program. exe file permissions or compatibility, and other operations.
In fact, these are not necessarily solve the problem, the best way is to recompile the win service to run the. exe project. Then replace the EXE file that generated the X86 with the original EXE file.
Specific steps:
1. Find the corresponding item, right----and the target platform is set to "X86"
2. Regenerate this project
3. Overwrite the corresponding. exe file in the Bin folder with the file with the same name you want to deploy
4, Installation Success!