-
Hi i get this error when i try to edit a header in a
Error:Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name 'GridHeaderCellContext' does not exist in the namespace '__Blazor.Havit.Blazor.Components.Web.Bootstrap' (are you missing an assembly reference?) PROJECTNAME C:\Users\Administrator\Source\Repos\PROJECTNAME\PROJECTNAME\Microsoft.NET.Sdk.Razor.SourceGenerators\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\Pages_Index_razor.g.cs 332 Active ExplanationI get the error whenever i try to use @page "/"
@using System.Globalization
<HxGrid TItem="CultureInfo" Responsive="true" DataProvider="DiagnosticFilesGridComponentGetGridData" ContentNavigationMode="GridContentNavigationMode.Pagination">
<Columns>
<HxGridColumn HeaderText="File last Written" ItemTextSelector="@(item => item.DisplayName)" SortKeySelector="@(item => item.DisplayName)">
<HeaderTemplate>
<HxInputDate @bind-Value="filterDate" Placeholder="Filter by date" InputSize="InputSize.Small" />
</HeaderTemplate>
</HxGridColumn>
<HxContextMenuGridColumn Context="item">
<HxButtonGroup>
<HxButton Color="ThemeColor.Primary" >View</HxButton>
</HxButtonGroup>
</HxContextMenuGridColumn>
</Columns>
</HxGrid>
@code {
[Parameter]
public int? AgentIdParameter { get; set; }
private string agentsGridComponentNameFilter = string.Empty;
private string filterDiagnosticsFileName = string.Empty;
private DateTime? filterDate;
private bool agentsGridComponentNameSearchOnlyIsDead = false;
private async Task<GridDataProviderResult<CultureInfo>> DiagnosticFilesGridComponentGetGridData(GridDataProviderRequest<CultureInfo> request)
{
return request.ApplyTo(new List<CultureInfo>());
}
} Project file <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Havit.Blazor.Components.Web" Version="4.2.2" />
<PackageReference Include="Havit.Blazor.Components.Web.Bootstrap" Version="4.2.2" />
</ItemGroup>
</Project> I've disassembled my DLL The full build output is: Build started...
------ Build started: Project: PROJECTNAME, Configuration: Debug Any CPU ------
Restored C:\Users\Administrator\Source\Repos\PROJECTNAME\PROJECTNAME\PROJECTNAME.csproj (in 21 ms).
C:\Users\Administrator\Source\Repos\PROJECTNAME\PROJECTNAME\Microsoft.NET.Sdk.Razor.SourceGenerators\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\Pages_Index_razor.g.cs(332,503,332,524): error CS0234: The type or namespace name 'GridHeaderCellContext' does not exist in the namespace '__Blazor.Havit.Blazor.Components.Web.Bootstrap' (are you missing an assembly reference?)
Done building project "PROJECTNAME.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== Note
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
This is a common Blazor issue usually caused by naming collision or missing See related issues:
Or check the pages describing the symptom and possible causes: (To double-check, I tried your repro-code in our |
Beta Was this translation helpful? Give feedback.
-
Thanks for your answer @hakenr , although last night i fixed it by restarting by VM and updating (by reinstalling) Visual Studio Enterprise 2022 to version 17.7. I changed nothing in the code before and after the update so I don't know about missing You can mark this as fixed if someone comes along a similar problem, hopefully this will be usefull for them. |
Beta Was this translation helpful? Give feedback.
-
Hypothesis: It seems the VS reinstall updated your .NET SDK to newer version where there were some fixes in Razor compiler. |
Beta Was this translation helpful? Give feedback.
Thanks for your answer @hakenr , although last night i fixed it by restarting by VM and updating (by reinstalling) Visual Studio Enterprise 2022 to version 17.7.
I changed nothing in the code before and after the update so I don't know about missing
@using
but thanks, I noticed that problem in other projects, its quite common sadly. Hopefully the compiler will producer better error messages in the future.You can mark this as fixed if someone comes along a similar problem, hopefully this will be usefull for them.
Thanks for a great library! 🎉😊
// Oscar