Open ForgeColeColon opened 10 months ago
So, are you saying you were able to fix the problem? Could you tell me a little more details about your code and which version of .NET you are using?
Sure. I have a .csproj targeting netstandard2.0. I am not able to use NACHA.NetStandard because it is targetting netcoreapp2.1. If NACHA.NetStandard was targetting netstandard2.0, then it would be compatible with .net45, netstandard2.0, and all net core frameworks. I thought that might have been your goal with this version, but i could be wrong. So i was just throwing it out there that this is currently not compatible with netstandard2.0 projects.
hmmm, do you know if its compatible with anything like .NET6, .NET 7 or .NET 8? Based on what you said, it sounds like its only meant to work with those older deprecated frameworks...and not the new .NET stuff??
Thanks for responding so quickly.
Yes it is. This was what my work around was. Since the .csproj I was using it in was netstandard2.0, I had to create a new project in net6.0 and install NACHA.NetStandard there in order to keep my other project in netstandard2.0 for nuget packaging reasons.
Pasted simple project i just created targeting netstandard2.0 on how to reproduce.
I was bummed when my brand new .NET 8 project blew up when trying to use this ChoETL.Nacha nuget package in visual studio 2022. The C# code came from a .net 4.6.1 (4.6.2?) project that has worked fine for a while now. And after making the syntax changes to the .NET8 code, I tried to debug it and it blew up. Dang, it sounds like it might not be a lost cause.
I am so glad you are posting some stuff here. thank you!!!
I believe if you just make the following change to your .csproj
<TargetFramework>netstandard2.0</TargetFramework>
everything should be fine. Would you mind trying it?
Oh wait a sec....the csproj file is set to<TargetFramework>net8.0</TargetFramework>
since I created a brand new .NET8 project in visual studio, and just moved the old code into the new .NET8 project.
Because I wanted to move the old code into .NET8 while still using this choETL.NACHA. So when I changed target framework like this
<TargetFramework>netstandard2.0</TargetFramework>
Then the compiler blows up, since there are .NET8 syntax/code changes made to some parts of the code (just like loops, declarations stuff like that, but the NACHA code didnt get changed yet).
So I am wondering if I can use this and still get this ChoETL.Nacha to work with:
<TargetFramework>net8.0</TargetFramework>
i meant the ChoETL.NACHA.NETStandard.csproj should be netstandard2.0. that will fix problems with all projects referencing it.
i meant the ChoETL.NACHA.NETStandard.csproj should be netstandard2.0. that will fix problems with all projects referencing it.
so are you talking about downloading the code (including the ChoETL.NACHA.NETStandard.csproj ) from github (not the nuget package that I am referencing now) and changing that target framework in that downloaded github code to be like this
<TargetFramework>netstandard2.0</TargetFramework>
and then recompile that code and use it in the .NET8 project?
PS Also, I opened up that file and see this:
correct, the netcoreapp2.1 is why it is currently not working.
OK, I see. Normally I dont download and use directly from github, since visual studio has some nuget packages available for the ChoETL stuff. But in this case, I see there is the sln file in github, and the files and folders etc. So I will give that a shot, download all of it, then (make the change) and recompile it in Visual studio.
PS Any thought on which version of vs.net I should use for compiling it?
Thanks!
Yeah, sorry, i thought you were the code owner trying to fix this issue. This package works for me in .net 6. What breaks in .net 8?
ahh, nope not owner. Just a new user and it sounded like you were having maybe similar problem, so i thought I should at least ask. I am thinking if its working for your .NET 6, then it should hopefully work for me too in .NET8. That would be very good!
I posted an issue here. Basically it dies as soon as it tries to execute this in the for loop foreach (var data in new ChoNACHAReader(filename)) https://github.com/Cinchoo/ChoETL.NACHA/issues/57
try this: var builder = new StringBuilder(File.ReadAllText(fileName)); foreach (var data in new ChoNACHAReader(builder)) {
}
thanks. Will give it a try and let you know. :-)
Did that end up working? I believe it should have, cause it bypasses the GetEncoding call that was causing your error.
Thanks again!.....So, been testing it, seems to have worked. Need to do more testing tomorrow though. I am wondering why GetEncoding was blowing up. Did you encounter issues with it blowing up in your .NET 6 app?
https://github.com/Cinchoo/ChoETL.NACHA/blob/a48e7d37e07abae3608a714c439f289764edf1ab/ChoETL.NACHA.Core/ChoETL.NACHA.NETStandard.csproj#L5
This is targetting .net core, not .net standard. The moment you try to instantiate NachaWriter in a .netstandard library, it errors with System.Runtime incompatibility.
Took days to figure this out, because the name of the project is literally ChoETL.NACHA.NetStandard. Should be NetCore.