OpenXml and Unable to create mutex

后端 未结 4 1539
Happy的楠姐
Happy的楠姐 2021-01-06 13:00

I tried to create Excel document through openXml lib, but when i wanna create Excel from large number of data, server shoe me Unable to create mutex. (Exception from

4条回答
  •  醉话见心
    2021-01-06 13:53

    OpenXML uses IsolatedStorage for large file sizes. More info at http://www.lyquidity.com/devblog/?p=65

    You can find isolatedStorage folder in C:\Users\username\AppData\Local. What we found was that when this folder was empty we weren't getting the "Unable to create Mutex" exception. We also weren't getting the exception right after we would restart our IIS. We figured out it's got to be something to do with other web apps using and locking that folder, hence the mutex exception from OpenXml.

    After more searching we found that DotNetOpenAuth might also be using Isolated storage as per https://github.com/DotNetOpenAuth/DotNetOpenAuth/issues/381 for it's reporting feature. Some of our apps were using it and the moment they started up they would create files and folders in the IsolatedStorage folder after which the Mutex exception would start happening.

    You can disable DotNetOpenAuth reporting by changing the following flag to false in your Web.config

    
    

    This fixed it for us

提交回复
热议问题