Missing GetRecords
Im using ASP.net 5 with an MVC6 project and when i try to reference savReader.GetRecords it throws and error that it isnt found
Take a look at where the CsvHelper.dll is referenced. I bet it's going to the 2.0 folder. If this is the case, remove it, and manually add it to the correct folder in the NuGet package. NuGet has issues it certain scenarios where it'll use the 2.0 version instead of the 4.0 client profile version.
Hi Josh,
Sorry im new to all of this. Im using VS2015 and just referenced CSVHelper in my project.json. HOw do i check the reference and manually update it?
Hmm... I haven't used a version that uses project.json yet. Do you have a references folder that lists all of the assemblies that the project is using, or is it just the json file? Does the json file have paths to the assemblies in it?
OK i found them DNX (Asp.net 5) saves them to C:\Users[UserName].dnx\Packages[Package]
So i have version 2.13.2 and in this folder i have a lib, CsvHelper.2.13.2.nupkg, a SHA512 and nuspec Files
I don't know if .NET 4.0 or PCL assemblies work with DNX. That is something I will have to into further. I haven't done anything with it since it's still in beta.
OK, yeah im going to have to try and track down how it determines which version to use. As i see no true linking between the new project and the nuget package
Found it. there is project.lock.json which has the references and it showing in several places. Ill update them here but need to know how to fix this so the next update doesnt break it
"CsvHelper/2.13.2": {
"type": "package",
"compile": {
"lib/net20/CsvHelper.dll": {}
},
"runtime": {
"lib/net20/CsvHelper.dll": {}
}
},
I'm guessing whatever it is that determines which version to download is choosing the wrong one... Or none of the other packages are compatible. There is .NET 4.0 client profile, and PCL. It could be that neither of those are compatible with DNX. I may have to make a DNX specific package, but I'm not sure.
Let me know if you get it working. I will take a look at this (DNX support) at some point, but it probably won't be soon.
I look at other project that im referencing and i noticed that you .Net 4 folder is called net40-client while others are calling it net40. You can look at the Automapper nuget package for example. as this appears to be how DNX if choosing the package and since net20 is the only one it sees as valid it choosing that one as it looking for net40
I get an error that it doesnt support 4.5 so no luck. Ill wait until theres a 4.5 version. Thanks Josh
net40-client is .NET 4.0 client profile. The client profile is just a smaller set of .NET and is usable in more places than the full .NET library. If net40 works, net40-client should too.
I managed to get it to work. I was doing a Replace All "net20" with "net40-client" and didnt realize there a section where it list all the available versions for each package and it was replacing there as ell. Once i manually replaced just the sections for DNX Targets its appears to be working
Oh that's good. I'll look into having a DNX specific build in the future. Probably once it's closer to release.
I have just run into this issue as well. LorenDorez's solution works, but it is a temporary fix and I cannot figure out how to make this permanent.
@dlras2 I havent had an issue with mine. How is yours being Temporary?
Whenever project.lock.json is regenerated they are reset to net20. I'm not sure what the criteria are for this file be regenerated, but I know it's happened several time, and is not checked in to source control so will break when built on a fresh machine.
I just posted to the DNX Github and speaking with David Fowler right now
Great!
@LorenDorez check issue #44 for a hack I posted that will save you from having to re-edit your project.lock.json every time it changes. It's a hack of course, and doesn't address the root cause of the problem, but it makes this easier.
.NET Core is now supported and the client profile isn't used anymore, so this issue shouldn't happen now.