0

I am taking a console app I have that loads new data into a database, and am turning it into a web job that runs at 2am so the stored data is updated daily. The console app works fine locally and is using an Azure SQL database. When running the webjob it fails with this message:

[09/22/2016 20:25:39 > 44575f: SYS ERR ] Job failed due to exit code -532462766

Through some research it looks like the webjob doesn't have my app.config file and thus is missing the correct connection string, but I'm not sure. Does anyone know how to get around this? Do I add a connection string to my .pubxml file, do it in my Azure portal, or could this be something else? Thanks!

  • 4
    -532462766 is 0xE0434352, which is just the general code for "unhandled CLR exception". Give your console application some proper error handling (`AppDomain.UnhandledException` if nothing else) to see what it's actually failing on. If it won't start at all, then on non-Azure hosts this is typically logged in the application event log. I'm not familiar enough with Azure to know how things go there. – Jeroen Mostert Sep 22 '16 at 20:47
  • 1
    Usually when an application runs on a local PC and fails on a Server is is usually a credential issue. In most cases the application is trying to write a file on the server and the user doesn't have the authentication to write on server. Make sure application is writing on client PC and not server. – jdweng Sep 22 '16 at 20:48
  • I actually fixed the problem, web jobs will disregard the app.config and look for a web.config. I simply created a web.config in the console app that was the same as the app.config and republished. – Lucas Huet-Hudson Sep 22 '16 at 21:15
  • Try this [link](https://stackoverflow.com/a/46110720/6720721) for the same. ... – Vidyesh Sep 08 '17 at 07:22
  • @JeroenMostert -532462766 isn't -13D5F5ED3 hex, or EC2A0A12C? – Csaba Toth Aug 26 '18 at 05:38
  • 1
    @CsabaToth: no -- the exit code is a 32-bit value. (And 0x13d5f5ed3 is 5324627667, so I think you've got one digit too many there.) – Jeroen Mostert Aug 26 '18 at 06:20
  • @JeroenMostert You are right, somehow an extra digit sneaked into my calculations. It comes out to −1FBCBCAE, aka E0434351 – Csaba Toth Aug 26 '18 at 06:28

1 Answers1

2

web.config is a strange choice but I guess webjob falls back to it. You could also fix the problem by copying the programname.exe.config file along with the exe itself.