I'm trying to embed the following switch setting in my console application but I need the app.config to not be necessary. Is there another way to set this switch within the app?
I have come across AppContext.SetSwitch but this is only available in .NET 4.6, but my app will need to run on XP machines. Is there another way of doing this?
<runtime>
<AppContextSwitchOverrides value="Switch.System.IO.UseLegacyPathHandling=false;Switch.System.IO.BlockLongPaths=false" />
</runtime>