We use this component and experienced deadlocks with multiple threads calling ZipArchive.Entries.get(). The code using ZipArchive in StaticContent.cs is not thread safe (non-static members of ZipArchive/ZipArchiveEntry are not thread safe) nor is enumerating the collection of ZipArchiveEntry's. We fixed by putting a lock around:
here is my advice:
there are two methods in ServiceContract ISwaggerWcfEndpoint, remove the second (StaticContent), host the index.html by yourself, keep the first which provider the swagger.json content.
We use this component and experienced deadlocks with multiple threads calling ZipArchive.Entries.get(). The code using ZipArchive in StaticContent.cs is not thread safe (non-static members of ZipArchive/ZipArchiveEntry are not thread safe) nor is enumerating the collection of ZipArchiveEntry's. We fixed by putting a lock around:
ZipArchiveEntry file = _archiveCustom.Entries.FirstOrDefault(entry => entry.FullName == filename); file.Open();
We also copy the stream from file.open() into a MemoryStream and return that instead of the underlying stream.