How do I properly rename a .razor file in vs2019?

I had to restart my Visual Studio. No additional fixes were required. The problem seems to be some cached data.


Checklist:

  1. Your component name should starts with a capital letter, as Counter and not counter.

  2. The file name without extension is the name of your component

Thus, if you name the file name Counter.razor, your component name is Counter,

and it should be used like this :<Counter />

The error you received may also be attributed to failing to import the namespace where your component resides (in case you've defined it in a new folder you added to your app).


Restarting VS often works. When it doesn't I've found opening the component and resaving (maybe with a superficial edit) can resolve