CsvHelper icon indicating copy to clipboard operation
CsvHelper copied to clipboard

[request]For Unity

Open shinriyo opened this issue 7 years ago • 7 comments

CsvHelper is good tool in the planet. But, install for Unity is quite inconvenience. I unzuped .nupkg and get dll file.

I hope it release for Unity Asset Store or just download link.

shinriyo avatar Apr 30 '18 02:04 shinriyo

I'll look into it. I haven't done it before, so I'm not sure what I'm getting into here. :)

JoshClose avatar May 29 '18 14:05 JoshClose

Are you familiar with how to create a unity asset for the store?

JoshClose avatar Jun 12 '18 17:06 JoshClose

I just submitted it to the asset store. We'll see if it gets approved.

JoshClose avatar Jun 12 '18 19:06 JoshClose

perhaps an alternative is https://github.com/GlitchEnzo/NuGetForUnity ?

SimonCropp avatar Sep 18 '20 01:09 SimonCropp

That looks awesome. Unity rejected the asset store request because they didn't think the documentation was good enough. Having every library in NuGet have to submit their own asset to the store seems silly. This is a much better way to do things.

If someone can verify this works, I'll update the documentation to point Unity people to this.

JoshClose avatar Sep 18 '20 16:09 JoshClose

Hi @JoshClose ! :)

I tested CSVHelper from NuGetForUnity, I got some issues on iOS build:

NullReferenceException: Object reference not set to an instance of an object.

Managed Stack Trace:

System.Linq.Expressions.Interpreter.LightLambda.MakeRunDelegateCtor (System.Type delegateType) (at <00000000000000000000000000000000>:0)
System.Linq.Expressions.Interpreter.LightLambda.GetRunDelegateCtor (System.Type delegateType) (at <00000000000000000000000000000000>:0)
System.Linq.Expressions.Interpreter.LightLambda.MakeDelegate (System.Type delegateType) (at <00000000000000000000000000000000>:0)
System.Linq.Expressions.Expression`1[TDelegate].Compile (System.Boolean preferInterpretation) (at <00000000000000000000000000000000>:0)
CsvHelper.ObjectCreator.GetFunc (System.Type type, System.Object[] args) (at <00000000000000000000000000000000>:0)
CsvHelper.ObjectCreator.CreateInstance (System.Type type, System.Object[] args) (at <00000000000000000000000000000000>:0)
CsvHelper.ObjectCreator.CreateInstance (System.Type type, System.Object[] args) (at <00000000000000000000000000000000>:0)
CsvHelper.ObjectResolver+<>c__DisplayClass17_0.<.cctor>b__1 (System.Type type, System.Object[] args) (at <00000000000000000000000000000000>:0)
System.Func`3[T1,T2,TResult].Invoke (T1 arg1, T2 arg2) (at <00000000000000000000000000000000>:0)
CsvHelper.ObjectResolver.Resolve[T] (System.Object[] constructorArgs) (at <00000000000000000000000000000000>:0)
CsvHelper.Configuration.CsvConfiguration.RegisterClassMap[TMap] () (at <00000000000000000000000000000000>:0)
Com.Atomicorn.TestCSVHelper..ctor () (at <00000000000000000000000000000000>:0)
System.Threading.ContextCallback.Invoke (System.Object state) (at <00000000000000000000000000000000>:0)
System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <00000000000000000000000000000000>:0)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () (at <00000000000000000000000000000000>:0)
System.Action.Invoke () (at <00000000000000000000000000000000>:0)
System.Threading.ContextCallback.Invoke (System.Object state) (at <00000000000000000000000000000000>:0)
System.Threading.Tasks.AwaitTaskContinuation.RunCallback (System.Threading.ContextCallback callback, System.Object state, System.Threading.Tasks.Task& currentTask) (at <00000000000000000000000000000000>:0)
System.Threading.Tasks.Task.FinishContinuations () (at <00000000000000000000000000000000>:0)
System.Threading.Tasks.Task`1[TResult].TrySetResult (TResult result) (at <00000000000000000000000000000000>:0)
System.Threading.Tasks.TaskCompletionSource`1[TResult].TrySetResult (TResult result) (at <00000000000000000000000000000000>:0)
Com.Atomicorn.Common.Utils.Unity.Server.Request+<RequestCoroutine>d__32.MoveNext () (at <00000000000000000000000000000000>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <00000000000000000000000000000000>:0)
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <00000000000000000000000000000000>:0)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) (at <00000000000000000000000000000000>:0)
System.Threading.SendOrPostCallback.Invoke (System.Object state) (at <00000000000000000000000000000000>:0)
UnityEngine.UnitySynchronizationContext.Exec () (at <00000000000000000000000000000000>:0)
UnityEngine.UnitySynchronizationContext.Exec () (at <00000000000000000000000000000000>:0)
UnityEngine.UnitySynchronizationContext:Exec()

Android build, same kind:

2021/01/05 19:48:55.950 23262 23294 Error Unity NullReferenceException: Object reference not set to an instance of an object.
2021/01/05 19:48:55.950 23262 23294 Error Unity   at System.Linq.Expressions.Interpreter.LightLambda.MakeRunDelegateCtor (System.Type delegateType) [0x00000] in <00000000000000000000000000000000>:0 
2021/01/05 19:48:55.950 23262 23294 Error Unity   at System.Linq.Expressions.Interpreter.LightLambda.GetRunDelegateCtor (System.Type delegateType) [0x00000] in <00000000000000000000000000000000>:0 
2021/01/05 19:48:55.950 23262 23294 Error Unity   at System.Linq.Expressions.Interpreter.LightLambda.MakeDelegate (System.Type delegateType) [0x00000] in <00000000000000000000000000000000>:0 
2021/01/05 19:48:55.950 23262 23294 Error Unity   at System.Linq.Expressions.Expression`1[TDelegate].Compile (System.Boolean preferInterpretation) [0x00000] in <00000000000000000000000000000000>:0 
2021/01/05 19:48:55.950 23262 23294 Error Unity   at CsvHelper.TypeConversion.SByteConverter..ctor () [0x00000] in <00000000000000000000000000000000>:0 
2021/01/05 19:48:55.950 23262 23294 Error Unity   at CsvHelper.TypeConversion.SByteConverter..ctor () [0x00000] in <00000000000000000000000000000000>:0 
2021/01/05 19:48:55.950 23262 23294 Error Unity   at CsvHelper.ObjectCreator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in <00000000000000000000000000000000>:0 
2021/01/05 19:48:55.950 23262 23294 Error Unity   at

Unity version: 2019.3.7f1 CSVHelper version: 19.0.0

TheoSabattie avatar Jan 05 '21 18:01 TheoSabattie

Hi @TheoSabattie, I know your problem is old, but maybe for future readers, this may be a solution:

https://github.com/JoshClose/CsvHelper/issues/1390#issuecomment-863128756

Glokta0 avatar May 18 '22 09:05 Glokta0