ExcelDataReader not working in Class Library project - exceldatareader

Receiving the following error when trying to run a Server Process, class library project:
"ERROR : Error (0) Could not load file or assembly 'ExcelDataReader, Version=3.6.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa' or one of its dependencies. The system cannot find the file specified."
I have installed the respective ExcelDataReader and ExcelDataReder.DataSet packages via NuGet.
You can see all is loaded in the following screenshot:
Visual Studio Screenshot
Any suggestions most welcome, please?
Thank you.

I can 100% recommend the GemBox Excel solution. This works perfectly in my .net standard 2.0 library solution.
https://www.gemboxsoftware.com/spreadsheet

Related

System.Threading.Tasks.Extensions unloaded by IIS

I have a project with assembly which refers to System.Threading.Tasks.Extensions, Version=4.6.28619, It's an old ASP.NET App hosted on IIS. After compilation, the app is running and everything is OK. After some time, the app throws an exception.
"System.Exception: Could not load file or assembly
'System.Threading.Tasks.Extensions, Version=4.1.0.0, Culture=neutral,
PublicKeyToken=cc7b13ffcd2ddd51.
After the recompilation and restarting the APP, everything works fine, but after a few hours, the exception is thrown again. What could be the problem?
I have tried to change web.config to use System.Threading.Tasks.Extensions in the correct version, but it didn't help.
Version=4.6.28619 is file version, not the Assembly Version. I did goodle on System.Threading.Tasks.Extensions history.
I found the 4.3.0 should be the correct version in your project.
Other version couldn't find 4.1.0.0 version dll like picture above. Package version >=4.4.0, using 4.1.1.0. <4.3.0, using 4.0.0.0.
Now you can follow the suggestions below to check the issue
Find the package System.Threading.Tasks.Extensions like my first picture.
If you have multi project, make sure all the projects using the same version package.
Delete the .vs folder
Check the web.confg/app.config file, and check the version of System.Threading.Tasks.Extensions, if there are duplicates, please delete them.
If the steps above not works for you, maybe the issue related to deployment. You can try the binding redirects.

Why does building with Microsoft.Xml.SgmlReader 1.8.18 nuget output this warning MSB2346

I'm using the Microsoft.Xml.SgmlReader nuget in several places of my .Net Core 3.1 projects.
The build output says:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2123,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not load file or assembly 'SgmlReader.exe' or one of its dependencies. The module was expected to contain an assembly manifest.
I'm unable to google what this really means or how I fix it. Maybe I should be using a different incarnation of the SgmlReader nuget, only this one (1.8.18) seems to be the one most up-to-date.
Edit:
No information reg. sgmlreader in fusion logs when building (or starting VS2019).
But I did notice these two in the references:
Compile Time Assemblies, SgmlReader.exe and SgmlReaderDll.dll
I can open SgmlReaderDll.dll in JustDecompile, but not SgmlReader.exe.
I also notice that the exe is part of netcoreapp3.1, but not netstandard2.0 and netstandard2.1. That does not look right to me.

Why SQLite crash in UWP with cannot find the file specified?

I install the SQLite from Nuget as below:
And after I ran the program it throws this error:
I feel strange that it showed the Version is 1.0.109.0 but not the version I installed which 1.0.109.2
What's more, I tried the way what Could not load file or assembly 'System.Data.SQLite, Version=1.0.109.0 - Why does it search for version 1.0.109.0 when I have referenced 1.0.109.1
said
But all the way no works.
In addition, I opened the .csproj and here is the SQLite package reference:
The version in .csproj is right.
What's wrong with it.Would you please tell me how to solve it? Thank you.
Make sure that the SQLite assembly gets copied to your output directory so it can be found at runtime. It should if you install the SQLite package in your UWP app project.

Couldn't install any packages .Net Framework NuGet

I have a solution with a lot of projects targeting .net framework but not any with .core NuGet. The case is that, quite occasionally I started getting the following error while trying to set up any package from manage NuGet packages
HRESULT E_FAIL has been returned from a call to a COM component
Did someone run into the same issue and how you managed to resolve it
Go to your C:\Users\{USER}\AppData\Roaming\Microsoft\VisualStudio folder, and you should find a folder in there called 15_{id}. Open it, and have a look at the ActivityLog.xml. If you have a look in it you should find the error in there and the library that's causing it. In my case it was caused by Microsoft.visualstudio.shell.interop.IVsReferenceManager2 within the Microsoft.VisualStudio.Shell.Interop.11.0.dll library.
This post helped me solve the issue then: Msdn forum
1.Open "Developer Command Prompt for VS 2017" as Admin
2.CD into "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PublicAssemblies"
3.Run "gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll"
After a restart, it all worked well.
Please Follow the Source
referencemanagerpackage-fails-to-install-vs-2017-community-edition

Unable to Get CodeDom dll to build, mismatch Assembly

I am running a 4.6.1 .NET Azure API. I'm trying to debug it locally, and I get this error.
The exact error says
Could not load file or assembly 'Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Now, I have searched for the standard responses. I checked my package config first:
Sure enough, it's the right version of 1.0.2. I then checked my reference to make sure my version is what it says it is.
So I check my local assembly just in case as well. Looks on point.
So what am I missing? Where else could it not match? The only solution I have found is to point the project's build settings to 'bin\' versus 'bin\debug', but that feels way too hacky.
What worked for me was simply uninstalling that package: Microsoft.CodeDom.Providers.DotNetCompilerPlatform
The code worked just fine with out it in my case. I was able to re-install the package and the code continued to work just fine as well. Git seems to think all the package files that came back are different to those that were there before uninstall.
I'm not sure why this worked, but it got me developing again.

Resources