There are several questions about this but my situation carries a caveat, no UI. There's 2 main solutions, neither of which I like. One repeated answer says to offload the work on a background thread. My app is started with command line parameters by another program and generates a report to a specific folder. I believe there's no reason it should have an unoccupied main thread to respond to input that it's not expected to receive and going to do anything with. The window's not even visible for a user to interact with. The other solution is to turn off the warning so it goes unnoticed. This sounds too much like ignoring a fire.
Can I change the thread's ApartmentState, Culture, or Principal to avoid this error? I must admit I don't know much about any of those things.