-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Can't create CsvConfiguration instance on .net standard 2.0 with object initializer #1646
Comments
I was using a library to get the feature into older version. Doesn't seem to work. I just did it in the source and it seems to work now. I'll include this in the next version that will be out within the next couple of hours. I want to fix the other issues people are seeing with it. |
I know, I have used the same nuget, but didn't do extensive testing with it. If you want to keep the CsvConfiguration a record you might want to try making it work. You could try not using the nuget for the init stuff but place the source code directry inside the project, and make the class internal |
Yes, I tried that and your example works with it. :) |
Ohh, sorry, I misread your comment. Thanks for the quick reactions, and the fix! |
Should be fixed in 21.0.0. https://www.nuget.org/packages/CsvHelper/21.0.0 |
Describe the bug
On 20.0.0 creating a CsvConfiguration with an Object initializer or using a "with" statement throws MissingMethod exception.
To Reproduce
Expected behavior
Can create CsvConfiguration with an object initializer
Screenshots
Additional context
Source:
Temp.Lib:
Temp console app:
Suggestion
Maybe instead of a record with init only properties, use a record with get only properties and optional constructor parameters?
The text was updated successfully, but these errors were encountered: