4

Having some free time I decided to start with C#, .NET, and Blazor pages.

Started with default Blazor page template (to examine how it works) and found that

  • when trying to build it on Jetbrains Rider 2020.01 it raise an App.razor(3, 32): [CS0103] The name 'routeData' does not exist in the current context
  • exactly same template (haven't found any differences) build on VisualStudio 2019 without any problems

As I couldn't find anything and I am a newbie in .NET world any direction I should look?

  • Can you find where routedata was set on statup? – Shane_Yo Apr 28 '20 at 17:26
  • @Shane_Yo: I can't. As I stated I am new to .NET and C# but I checked all source files included in starting template – Sebastian W Apr 28 '20 at 17:37
  • I am taking a stab, you should have a Global.asax,cs that calls something like RouteConfig.RegisterRoutes(RouteTable.Routes) You you should start there – Shane_Yo Apr 28 '20 at 17:45
  • @Shane_Yo: Thank you for pointing out a direction. There is no such file in project tree but at least I have an idea what I might be looking for. (Besides of that same base template runs fine when on Visual Studio) – Sebastian W Apr 28 '20 at 18:51
  • https://youtrack.jetbrains.com/issues/RIDER Report to JetBrains and see how they respond. – Lex Li Jul 25 '20 at 21:53

1 Answers1

0

After reproducing your steps, i experienced the same error that you've had... The reason is.. Jetbrains Rider's generated project is the same, because AFAIK Rider uses the default project generator(dotnet).

just reopen the project, if that does not work, create a new project using dotnet new blazorserver -o [your project name here] or just open the project generated in VS using Jetbrains Rider

I do not know what the reason of such error is.. But this solution helped me, and i hope that it will help you too.. If that does not help, feel free to comment it out..

Dude4
  • 163
  • 1
  • 8