dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.5k stars 10.04k forks source link

VS 2019 doesn't recognize custom blazor-components in c#code #17603

Closed TobiasKoller closed 4 years ago

TobiasKoller commented 4 years ago

I've created several small blazor-components.

One is called Dialog inside the Shared-folder (also tried other names).

When I try to use this component inside another component like

<mynamespace.Shared.Dialog @ref="_dialog">..

@code {
...
private mynamespace.Shared.Dialog _dialog;
...
}

the tag itself gets recognized but the property private mynamespace.Shared.Dialog _dialog; doesn't.

I get an error "the type or namespace Dialog could not be found (are you missing....)"

sometimes I still can compile even with this error, sometimes I can't.

just updated to latest VS2019 preview which seems to work...

javiercn commented 4 years ago

@TobiasKoller thanks for contacting us.

Can you provide details about the Visual Studio version you are using where this is not working?

TobiasKoller commented 4 years ago

sure, the current Version is 16.3.10 VS Professional 2019. I've just updated to 16.4.0 which seems to fix the issue.

Sorry didn't know there was an update.

TobiasKoller commented 4 years ago

v 16.4.0 fix this issue