gpt4 book ai didi

c# - 在 Jetbrains Rider 上构建时 Blazor App CS0103 错误,而在使用 VisualStudio 时没有错误

转载 作者:行者123 更新时间:2023-12-03 20:54:07 36 4
gpt4 key购买 nike

有一些空闲时间,我决定从 C#、.NET 和 Blazor 页面开始。

从默认的 Blazor 页面模板开始(检查它是如何工作的)并发现

  • 当尝试在 Jetbrains Rider 2020.01 上构建它时,它引发了 App.razor(3, 32): [CS0103] The name 'routeData' does not exist in the current context
  • 完全相同的模板(未发现任何差异)在 VisualStudio 2019 上构建,没有任何问题

  • 由于我找不到任何东西,而且我是 .NET 世界的新手,我应该寻找什么方向?

    最佳答案

    重现您的步骤后,我遇到了与您相同的错误...
    原因是..Jetbrains Rider 生成的项目是一样的,因为AFAIK Rider 使用的是默认的项目生成器(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


    我不知道这种错误的原因是什么..但是这个解决方案帮助了我,我希望它也能帮助你..
    如果这没有帮助,请随时发表评论..

    关于c# - 在 Jetbrains Rider 上构建时 Blazor App CS0103 错误,而在使用 VisualStudio 时没有错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61485946/

    36 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com