Alex Molskiy
Alex Molskiy

Reputation: 865

Console app working ok, but win service wont start

I`m writing c# win service which can monitor sybase replication server and using 3rd party library for this. First I wrote simple console app which just connect to the server and execute some command - everything work fine, then I create win service with the same code and it fall down with error on start.

Service cannot be started. System.BadImageFormatException: Could not load file or assembly 'ASEClientCT.dll' or one of its dependencies. is not a valid Win32 application.

I don`t understand why its can happen. Any help, pls.

Upvotes: 0

Views: 141

Answers (1)

manthan davda
manthan davda

Reputation: 329

Convert window service platform target to x86 instead of x64. Follow the below steps.

Right click on project Click on properties open Build Tab. Change Platform Target to x86. save the project and try again.

Upvotes: 1

Related Questions