'Path separator backslash in zip files, created from dll, .Net 4.8
I'm developing a dll in C# that should create a zip-archive. According to project settings in VS I use .Net Framework 4.8. So I assumed that this fix should be already applied and path separator should be forward slash by default.
However, for some reason that is not the case for me. I'm not sure what .Net version is used by third-party app that I'm developing a dll for (and if it is relevant).
Here's my sample code:
var compression = System.IO.Compression.CompressionLevel.Optimal;
var includeBaseDirectory = false;
ZipFile.CreateFromDirectory(dirPath, zipPath, compression, includeBaseDirectory);
I can't see any overloads for this method that allow me to use different path separator.
I tried using app.config (or my_dll_name.dll.config) file with <AppContextSwitchOverrides value="Switch.System.IO.Compression.ZipFile.UseBackslash=true" /> (or false) and that didn't seem to help either.
What else can I do?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
