Hi
I have merged 14.1 into my project and previously generated excel code no longer compiles. Where can I find a link that explains what to change to make the generated code work with 14.1
Thanks
Ps I am going to 14.2 but had some git lms issues so this is an intermediate step
3 Answer(s)
-
0
Hi @philipcj
Can you please specify which file is not being compiled? That way I can provide a more specific source. Thank you.
You can temporarily remove this issue regarding the lfs system from your locale regarding the 14.2 transition here. We have created a pull request to fix this issue.
After pulling the aspnet-zero-core project to your locale with git, you can pull the source of the relevant files by running the
git lfs pullcommand. You can manually move thefontsandmetronicfolders underwwwrootto your project. At the same time, you need to remove the.gitattributesfile under MVC from your project.Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi
I'm sorry for the confused message. The git lfs issue is on another ticket and I've managed to resolve that - have answered on that ticket. So those two aspnet zero projects are at 14.2 and are ready to get started with. This one, I have upgraded from 13.2 to 14.1, with the intention, if it works, to get it to 14.2 - as I now know how to do that. So this is nothing to do with git lfs as 14.1 doesn't use it. I'm not going to 14.2 because the merge I am doing and the git lfs don't like each other - don't worry about this, I just want to get 13.2 to 14.1 working.
After all those words :-) the compile error is in the C# and its this, because I have previously generated some Excel code:
Cannot implicitly convert type 'System.Threading.Tasks.Task<System.Collections.Generic.List<Spherical.Abraquest.MasterAdmin.MasterRef.Importing.Dto.ImportMasterRefSeriesDto>>' to 'System.Collections.Generic.List<Spherical.Abraquest.MasterAdmin.MasterRef.Importing.Dto.ImportMasterRefSeriesDto>'
This is in MasterRefSeriesListExcelDataReader.cs
'MasterRefSubjectListExcelDataReader' does not implement interface member 'IExcelDataReader<ImportMasterRefSubjectDto>.GetEntitiesFromExcel(byte[])'. 'MasterRefSubjectListExcelDataReader.GetEntitiesFromExcel(byte[])' cannot implement 'IExcelDataReader<ImportMasterRefSubjectDto>.GetEntitiesFromExcel(byte[])' because it does not have the matching return type of 'Task<List<ImportMasterRefSubjectDto>>'.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
1
Hi @philipcj
Error 1: Cannot implicitly convert type 'Task<...>' to '...'
This error occurs when you try to assign a value of type
Task<List<ImportMasterRefSeriesDto>>directly to a variable of typeList<ImportMasterRefSeriesDto>. In other words, you are trying to equate the "promise" of a result (the Task) with the actual "result" (the List).Error 2: 'MasterRefSubjectListExcelDataReader' does not implement interface member ...
This error means that a class (
MasterRefSubjectListExcelDataReader) claims to implement an interface (IExcelDataReader<...>), but it does not provide a method with the exact signature (especially the correct return type) required by that interface.public interface IExcelDataReader<TEntityDto> { Task<List<TEntityDto>> GetEntitiesFromExcel(byte[] fileBytes); }// Correct Class Implementation
public class MasterRefSubjectListExcelDataReader : IExcelDataReader<ImportMasterRefSubjectDto> { // SOLUTION: The method is marked as 'async' and the return type is changed to 'Task<List<...>>'. public async Task<List<ImportMasterRefSubjectDto>> GetEntitiesFromExcel(byte[] fileBytes) { //... return list; } }Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)