Using dash/hyphen in Razor Page filename - does compile but VS shows errors

喜你入骨 提交于 2019-12-24 18:25:09

问题


There seems to be an issue with the Razor Pages (2.1.0-preview1-007211) and IntelliSense in Visual Studio 2017 (15.4.0 preview 2.0) with the filenames containing dashes.

In order to reproduce:

  • Create a new razor page e.g. razorpagetest.cshtml
  • In the code add

    @{
       ViewData["Title"] = "Test123";
    }
    
  • Save and close the file

  • Rename razorpagetest.cshtml to razor-pagetest.cshtml
  • Save and close the file
  • Reopen the file and you will see errors on the errors list (although it builds OK)

Has anyone experienced this issues? Are there any workarounds?

来源:https://stackoverflow.com/questions/46319581/using-dash-hyphen-in-razor-page-filename-does-compile-but-vs-shows-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!