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

Porting to .net standard #31

Open
Markeli opened this issue Jan 26, 2019 · 22 comments
Open

Porting to .net standard #31

Markeli opened this issue Jan 26, 2019 · 22 comments

Comments

@Markeli
Copy link

Markeli commented Jan 26, 2019

We are using your library in our project and recently migrated it to .net core. Are you planning to migrate library to .net standard?

@grishin
Copy link

grishin commented Feb 2, 2019

I did a simple project type change here https://github.com/grishin/SPSS-.NET-Reader/tree/netstandard/SpssLib . All tests are passing. Didn't use it in production though.

@Mikael-Gustavsson
Copy link

Any plans on publishing the .net standard port on nuget.org?

@tonykaralis
Copy link

I would also be interested to know if this will be officially migrated. @grishin do you foresee any issues using this in production?

@Markeli
Copy link
Author

Markeli commented Mar 2, 2019

We are already have used SPSS in production the last few weeks. First problem is that in original library default encoding was not UTF-8. But it easy to fix with explicit setting encoding via SPPSOptions. And second problem is working with fractional numbers. We are looking for the solution now.

@tonykaralis
Copy link

@Markeli Do you have issues with the default encoding when reading or writing files?
I have copied the files over to a .NET Standard project in an attempt to port it over. All tests pass except for the TestReadFile which is throwing the following:

: System.NotSupportedException : No data is available for encoding 1252. 
For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.

Have you faced similar issue?

@Markeli
Copy link
Author

Markeli commented Mar 2, 2019

@tonykaralis, no, we didn't face. Our customer have some scripts for sav file analisys and they developed for Windows-1251 encoding. Did you try to isntall packages with aditional encodings (System.Text.Encoding.CodePages)?

@tonykaralis
Copy link

I downloaded the package from nuget but still no difference. I must have messed something up when porting as running @grishin fork which is .NET Standard 2.0 works fine. I am on .NET Standard 2.2. This might be an issue.

@tonykaralis
Copy link

Doing a bit more research I found the following article Core and encoding 1252. This is what i thought to be the issue after your suggestion @Markeli . Adding the following loc:

    Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

to the SpssReader constructor didnt work, neither did adding it to the .NET Core test project.

It now throws a new error

SpssLib.FileParser.SpssFileFormatException : Encoding not recognized: CP1252

This leads me to believe something else is lacking in order to make this work in a .NET Core environment.

When migrating did you have to change the underlying code of this library to get it to work?
I cant seem to get that 1 critical test to pass.

@tonykaralis
Copy link

Hi All, Sorry for the many messages.
Managed to get it working and compatible with .NET Core by making a few simple changes. It does break compatibility with .NET Framework but thats outside of the scope of this issue.
Here is a working version for anyone looking in the future .NET Core compatibility.

@Mikael-Gustavsson
Copy link

It is possible to keep compatibility with .net core AND .NET framework, I had it working on my computer before leaving for a week long vacation.

@tonykaralis
Copy link

I have added the compatibility by specifying an additional target framework. Builds and all tests pass on both platforms.

@grishin
Copy link

grishin commented Mar 4, 2019

I apologize for the late reply. Our management team canceled the project where we expected to use this library. So I had no chance to use it in real production environment.

@Mikael-Gustavsson
Copy link

@tonykaralis SpssLib, being a .net standard library, does not need multitargeting. I suggest removing the "net471" target from SpssLib and adding <RestoreProjectStyle>PackageReference</RestoreProjectStyle>
to Test.SpssLib.csproj. The tests should pass once that is done.
See dotnet/standard#481

@tonykaralis
Copy link

I was not aware of that. Thanks for pointing that out. Will amend as suggested.

@mikhail-vazhenin
Copy link

Hi!
Are you planing to upload netstandard version to nuget?

@tonykaralis
Copy link

Hi @mikhail who are you referring to? The owner of the lib has been quiet for some time now.

@mikhail
Copy link

mikhail commented Feb 13, 2020

@mikhail-vazhenin ☝🏼

@mikhail-vazhenin
Copy link

mikhail-vazhenin commented Feb 13, 2020

@mikhail-vazhenin ☝🏼

Hi @mikhail who are you referring to? The owner of the lib has been quiet for some time now.

Sorry.
I have carefully read all messages and understood that owner and grishin are not planing to improve the project.

@tonykaralis, you are trying to convert project to netstandart. Do you get the any results?

@tonykaralis
Copy link

@mikhail-vazhenin yes I have successfully ported to .net standard. I can release a nuget package, just need to add some credits to the owner of the package. Will try and get this done by the weekend.

@mikhail-vazhenin
Copy link

@tonykaralis that would be great. Thanks

@tonykaralis
Copy link

Hi All, I am having a bit of an issue reading a large dataset. The spss file is 95mb but we load it into memory(.ToList() on the records) and the memory spikes to 3gb for the specific file. We have tried to keep the records passed around as IEnumerable, this helps with the memory but is not helping with indexing. Are there any know issues with loading large datasets with this lib?

I keep getting sequence contains no elements, but when we debug and step through it works fine.

@mikhail-vazhenin sorry I havent deployed the nuget yet, I am swamped trying to fix this bug (production ;) )

@Markeli
Copy link
Author

Markeli commented Jul 30, 2020

We've successfully porter library to .NET Standard. Also, we've been using it in production since March without troubles. Feel free to use it: https://github.com/SIIS-Ltd/Curiosity.SPSS

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

No branches or pull requests

6 participants