question

sblb-6958 avatar image
0 Votes"
sblb-6958 asked sblb-6958 answered

Blazor wasm in VS CODE

Hi,
I've tried to use blazor wasm in vs code and I have some difficulties to install things correctly.

I don't undserstant why <Nav / > is underlined
109432-capture.png



It's the things in another razor page all htlm is underlined.


Other point :
I would like to use radzen.blazor in vs code but it is not available for the moment, I would like to know if you know of any packages available in vs code with components already integrated such as datatable ... that are free!

dotnet-aspnet-core-blazor
capture.png (4.2 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @sblb-6958, Have you tried the steps in this article?

0 Votes 0 ·
sblb-6958 avatar image
0 Votes"
sblb-6958 answered

First of all, thanks to your answer.

The problem is resolved here : 4580


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

sblb-6958 avatar image
0 Votes"
sblb-6958 answered YinqiuYao-MSFT commented

Hello, thanks for the link but I don't want to use the radzen application,
I only want to use the radzen package for the UI e.g datagrid...
So I can configure the debugger in the following way :

     "configurations": [
     {
         "name": "Launch and Debug Standalone Blazor WebAssembly App",
         "type": "blazorwasm",
         "request": "launch",
         "program": "${workspaceFolder}/Server/bin/Debug/net5.0/WebApp2.Server.dll",
         "cwd": "${workspaceFolder}/Server",
            

     }
 ]

The problem is not with the debugger.
The Program.cs file it does not recognize the <App> and in my App.razor file I have this:
programs.cs
109891-capture.png


App.razor

109848-capture.png




I really don't understand why I've this ?
Have you an idea? thanks in advance



capture.png (6.3 KiB)
capture.png (17.0 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @sblb-6958,Can you share your current error message?

0 Votes 0 ·
sblb-6958 avatar image
0 Votes"
sblb-6958 answered AgaveJoe edited

Hi,
You will find the message that obtain when I run the debugging

110261-capture.png

I modified the Launch.json file to add "browser":edge and I don't have this message anymore.

So I still have the problem in program.cs and App.razor and also in the imports file. I suspect I'm missing some packages
In _imports.razor files
110233-capture.png



capture.png (7.6 KiB)
capture.png (1.7 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @sblb-6958,please check the ProjectReference in your .csproj file.

0 Votes 0 ·

I have the same issue with a new project.

 dotnet new blazorwasm

It only happens when the files, Navmenu.razor and/or_imports.razor are opened. If I close the files and VS Code. Then open VS Code and run....

 dotnet build

The problems do not show anymore until I open the files again. I can run the project without issue. I assume I'm missing an extension or there is an issue with intellisense. Anyway, it seems to have a problem with the "Shared" namespace. I can't figure it out.

0 Votes 0 ·
sblb-6958 avatar image
0 Votes"
sblb-6958 answered

Hi. I didn't see anything in csproj file.
In my side I launched

dotnet new blazorwasm myproject - ho

Normally I should do nothing in csproj file.
Crpoj file is configured when I do dotnet new...

?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

sblb-6958 avatar image
0 Votes"
sblb-6958 answered

Hi, have you an idea about this problem?
Thanks in advance

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

sblb-6958 avatar image
0 Votes"
sblb-6958 answered

Hi,
You will find hereafter the .cropj file


<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.3" PrivateAssets="all" />
<PackageReference Include="System.Net.Http.Json" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Shared\WebApp2.Shared.csproj" />
</ItemGroup>

</Project>

I don't hnow what I have to put in the cproj
Thanks in advance

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

sblb-6958 avatar image
0 Votes"
sblb-6958 answered

Hi,

When I build my app I add the error below :

error CS0246: Le nom de type ou d'espace de noms 'MainLayout' est introuvable (vous manque-t-il une directive using ou une référence d'assembly ?) [...source\repos\WebApp3\Client\WebApp3.Client.csproj]

This error is linked to the initial problem :
111866-capture.png

I don't have any idea how I can solve this issue. Can you help me about it?



capture.png (6.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.