fsprojects / ExcelProvider

This library is for the .NET platform implementing a Excel type provider.
http://fsprojects.github.io/ExcelProvider/
The Unlicense
141 stars 51 forks source link

Cannot load ExcelDataReader #67

Closed albertwoo closed 3 years ago

albertwoo commented 5 years ago

Description

未能加载文件或程序集“ExcelDataReader, Version=3.4.1.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa”或它的某一个依赖项。系统找不到指定的文件。

Related information

giuliohome commented 4 years ago

Any news? I'm having the same issue on .Net Framework too. As a workaround, should I manually add this dependency to the project, right? Please, confirm, thanks.

Well, actually it seems strange to me: I should not need such dependency for a file .xlsx. Furthermore, last version of ExcelDataReader is 3.6.0, so would it be ok to nuget it? I've added an assemblyBinding

<dependentAssembly>
  <assemblyIdentity name="ExcelDataReader" publicKeyToken="93517dbe6a4012fa" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-3.6.0.0" newVersion="3.6.0.0" />
</dependentAssembly>

Now next error is

Impossibile caricare il file o l'assembly 'ExcelDataReader.DataSet, Version=3.4.1.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa' o una delle relative dipendenze. Impossibile trovare il file specificato.

I assume I've to do the same also for this other package ExcelDataReader.DataSet ... FYI all the above worked fine for me.

albertwoo commented 4 years ago

I use paket, and I have to set specific version like below:

nuget ExcelProvider 1.0.1
nuget ExcelDataReader 3.6.0
nuget ExcelDataReader.DataSet 3.6.0
giuliohome commented 4 years ago

I don't use paket but it has a documentation about assembly bindings: https://fsprojects.github.io/Paket/dependencies-file.html#Controlling-assembly-binding-redirects

mjarosie commented 4 years ago

Had the same issue. I was able to use this package after invoking:

dotnet add package ExcelDataReader --version 3.4.1.0
dotnet add package ExcelDataReader.DataSet --version 3.4.1.0

which seems like a quick fix. I'm quite new to the .NET ecosystem, shouldn't these dependencies be handled implicitly when installing the ExcelProvider package?

quintusm commented 4 years ago

Hi @mjarosie .

Yes it should, but for some reason it doesn't

Will have another look at it to see if i can fix this.

halcwb commented 4 years ago

@quintusm Any update on this issue? When running code from a script (using paket generate-load-scripts), all works fine. but when trying to use the code from another project, the above error occurs.

Also you need to look at this: https://github.com/ExcelDataReader/ExcelDataReader#important-note-on-net-core

quintusm commented 4 years ago

HI @halcwb

Unfortunately this issue still exists. The nuget package currently specifically targets net45 and netstandard2.0 so if you target those platforms it brings down the correct dependencies. On other platforms is doesn't bring down the required packages and you get the runtime issues you are experiencing. The workaround currently is as follows: Manually add dependencies to the following nuget packages in addition to ExcelProvider:

The version number redirects should be handled automatically if you do this.

Hope this helps

I am working on new versions which should alleviate this. However, I need to update to FAKE5 first to sort out some issues with building and that is quite a large change and I have limited time available for this.

quintusm commented 3 years ago

Version 2.0.0 is released. This version is now built for netstandard2.0 only, and this issue should now be resolved. Closing this issue.