Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception thrown: 'System.MissingMethodException' in CsvHelper.Excel.dll #2280

Open
andres-olivares-ncontracts opened this issue Aug 8, 2024 · 5 comments
Labels

Comments

@andres-olivares-ncontracts
Copy link

andres-olivares-ncontracts commented Aug 8, 2024

I updated from from CsvHelper 27.2.1 to 30.0.1, and when calling the following:

using var stream = new MemoryStream(); 
await using (var excelWriter = new ExcelWriter(stream, new CultureInfo("en-US"))) // Fails - Exception thrown: 'System.MissingMethodException' in CsvHelper.Excel.dll 
{ 
    await excelWriter.WriteRecordsAsync(collection); 
}

return stream.ToArray();

image

image

Reverted back to CsvHelper 27.2.1 to keep it moving.

Originally mentioned here.

Thanks,

@JoshClose
Copy link
Owner

You'll need to submit an issue to that library.

@andres-olivares-ncontracts
Copy link
Author

andres-olivares-ncontracts commented Aug 9, 2024

What are the steps to do that? I thought I was doing that since it is occurring in the latest version of CsvHelper. If you mean CsvHelper.Excel and it has its own place to do this, how would I get there?

UPDATE: I found this repository: https://github.com/youngcm2/CsvHelper.Excel
Thanks.

@JoshClose
Copy link
Owner

Yes, sorry. That library uses this one and needs to be updated to match changes in this one. It looks like they were matching the numbering system and haven't updated it in a while.

@andres-olivares-ncontracts
Copy link
Author

I requested an update for this issue, but meanwhile how are you guiding your customers on upgrades when they have this issue to contend with? Has the current practice been to not upgrade, or is there a fix I am unaware of that allows to proceed using the latest CsvHelper? Just want to make sure I am not missing anything.

@JoshClose
Copy link
Owner

I have nothing to do with that Excel library. Personally, I would fix the issue in that library and submit a pull request. It looks like it's not maintained anymore. It also looks like this was forked from another library that isn't maintained anymore. You would have to fork it and make the changes. Honestly, I would say to find another library to migrate to at some point, unless someone else has forked and taken over.

Unless there is a specific feature of CsvHelper that you want, there's no need to update it to the latest. If you're only using it because it's a dependency of the Excel library, then you for sure don't need to update it. If you're using CsvHelper and the Excel library, that's where you may run into a problem.

For the most part, I don't even know about dependencies of CsvHelper. They don't contact me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants