Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Creating Blazor project from command line is giving warnings in VS Code

$
0
0

I have created a project in .NET 8 Blazor web app using commanddotnet new blazor -o ProductBlaze

Opening in VS Code is giving me warning such asFound markup with unexpected name Routes.razorSolution Explorer

I tried upgrading C# dev kit extension and .NET Install. But it is not working.

_Imports.razor

    @using System.Net.Http@using System.Net.Http.Json@using Microsoft.AspNetCore.Components.Forms@using Microsoft.AspNetCore.Components.Routing@using Microsoft.AspNetCore.Components.Web@using static Microsoft.AspNetCore.Components.Web.RenderMode@using Microsoft.AspNetCore.Components.Web.Virtualization@using Microsoft.JSInterop@using ProductBlaze@using ProductBlaze.Components

Counter.razor

@page "/counter"    @rendermode InteractiveServer // The name 'InteractiveServer' does not exist in the current context<PageTitle>Counter</PageTitle><h1>Counter</h1><p role="status">Current count: @currentCount</p><button class="btn btn-primary" @onclick="IncrementCount">Click me</button>    @code {        private int currentCount = 0;        private void IncrementCount()        {            currentCount++;        }    }

Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>