IPFS Daemon keeps getting terminated

I am running IPFS Desktop on Windows 10 and everytime I try to access IPFS via code in my c# application the daemon gets shutdown and I have no idea why?

I found this in the logs:

2024-10-03T00:47:23.674Z info: [daemon] api port busy
2024-10-03T00:47:52.403Z info: [web ui] app-quit requested
2024-10-03T00:47:52.403Z error: [ipfsd] start daemon Error: get ipfsd failed
at startDaemon (C:\Program Files\IPFS Desktop\resources\app.asar\src\daemon\daemon.js:213:37)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async startIpfs (C:\Program Files\IPFS Desktop\resources\app.asar\src\daemon\index.js:49:17)
at async setupDaemon (C:\Program Files\IPFS Desktop\resources\app.asar\src\daemon\index.js:116:3)
at async Promise.all (index 1)
at async run (C:\Program Files\IPFS Desktop\resources\app.asar\src\index.js:68:5)

So looks like the api port it uses is in use? How do I find out what port it is trying to use? And how do I set a new one?

I am new to IPFS so any help would be greatly appreciated!

Many thanks,
David.