Error on only Azure - 'Microsoft.ACE.OleDb.12.0' provider is not registered on the local machine

前端 未结 4 2006
抹茶落季
抹茶落季 2021-01-14 05:47

I am working with MS Excel files in my web application built in Azure environment. I never run into following error when I am trying to access the excel file on my developme

4条回答
  •  囚心锁ツ
    2021-01-14 06:40

    I also faced the same issue today. I am using Standard plan of Azure and access to deployment server is through Azure Web portal. I am not using Azure VM because it is a costlier option.

    One of my colleagues suggested to use OpenSDK, using which I ultimately could do Excel manipulation without using OleDb drivers.

    Some of the resources which helped me to accomplish what I wanted are these:

    1. https://www.microsoft.com/en-us/download/details.aspx?id=30425
    2. https://msdn.microsoft.com/en-us/library/office/hh298534.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-15
    3. reading Excel Open XML is ignoring blank cells

    Please make sure open sdk dll is copied to local. In my case, it was referencing the dll installed in my computer in program files. So when I uploaded to Azure, it gave a dll missing error. I had copy the dll separately to the bin folder. I think if we try nuget option of referencing the dll then this issue would not show up, 've not tried it myself though.

    Hope this helps someone who is looking for an alternative to Oledb, in case where installation of the dll on the server is not possible.

提交回复
热议问题