So I wrote service that is constantly checking some folder and if there are files, they are uploaded to Oracle Database.
Everything is working fine when I'm running it in Visual Studio in debug mode. But when I'm doing release and installing actual service and run it, it throws oracle exception when trying to connect:
Could not load file or assembly 'Oracle.DataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Service is running and working and writing this exception to log file, so this is not direct service problem. I'm installing this service on same machine where I run debugging so Oracle client is installed and working fine. I also tried to install in on another machine but it trows same exception.
My guess is that there is some problems with rights and how service runs but since it's my first windows service I have no idea where exactly problem is and what to look for. It's installing as local service, when debugging it's running as my user (if I'm correct).