我在 razor.g.cs 文件(升级到预览版 9)中出现了两种类型的 Blazor 服务器错误
I have two types of Errors in Blazor Server that appear in razor.g.cs files (upgrading to preview 9)
我创建了一个预览版 9 服务器 blazor 项目,并尝试将现有的预览版 6 转换为它,使用互联网上 public 的指南。 razor.g.cs 个文件中出现两种类型的错误(35 个错误):
错误 CS1662 无法将 lambda 表达式转换为预期的委托类型,因为块中的某些 return 类型无法隐式转换为委托 return 类型 BlazorStore9 C:...\obj\Debug\netcoreapp3.0\Razor\Pages\Admin\EditProductComponents\AddEditProductDescriptionImage.razor.g.cs
和
错误 CS1503 参数 6:无法从 'Microsoft.AspNetCore.Components.EventCallback' 转换为 'Microsoft.AspNetCore.Components.EventCallback' BlazorStore9 C:...\obj\Debug\netcoreapp3.0\Razor\Pages\Admin\EditProductComponents\AddEditProductDescriptionImage.razor.g.cs 326 Active
我设法根据该指南解决了所有错误(数千个),但最终停在这里,我该如何解决这个问题?
已解决:
出现错误是因为新的 Radzen 文件输入版本需要 TValue="string" 属性来设置其回调。
我创建了一个预览版 9 服务器 blazor 项目,并尝试将现有的预览版 6 转换为它,使用互联网上 public 的指南。 razor.g.cs 个文件中出现两种类型的错误(35 个错误):
错误 CS1662 无法将 lambda 表达式转换为预期的委托类型,因为块中的某些 return 类型无法隐式转换为委托 return 类型 BlazorStore9 C:...\obj\Debug\netcoreapp3.0\Razor\Pages\Admin\EditProductComponents\AddEditProductDescriptionImage.razor.g.cs
和
错误 CS1503 参数 6:无法从 'Microsoft.AspNetCore.Components.EventCallback' 转换为 'Microsoft.AspNetCore.Components.EventCallback' BlazorStore9 C:...\obj\Debug\netcoreapp3.0\Razor\Pages\Admin\EditProductComponents\AddEditProductDescriptionImage.razor.g.cs 326 Active
我设法根据该指南解决了所有错误(数千个),但最终停在这里,我该如何解决这个问题?
已解决: 出现错误是因为新的 Radzen 文件输入版本需要 TValue="string" 属性来设置其回调。