mvelosop / AspNetCore2CoreUI

ASP.NET MVC Core 2 project using CoreUI.io template
MIT License
88 stars 39 forks source link

Cannot create partial view that contains '-' in its name #4

Closed GiorgosBetsos closed 6 years ago

GiorgosBetsos commented 6 years ago

Trying to create a new partial view named, e.g., _app-myview, fails. However you can temporarily name the view to e.g. _AppMyView and then rename it to _app-myview.

Steps to reproduce:

  1. Open AspNetCore21CoreUI2.sln in Visual Studio Community 2017 v. 15.7.5
  2. Create a partial view in Views/Shared (Create as a partial view checkbox checked)
  3. Creating the view file fails. A screen-shot of the error message is attached.

create partial view

error message

mvelosop commented 6 years ago

Hi Giorgos,

I could see the error about the dash in the partial view name! I hadn't realized that, because I didn't create the partial views that way, I copied the html files from CoreUI and then renamed them.

On the other hand, since partial views basically start as an empty file, I usually create them with [Shift]+[F2] (from extension Add New File)

Hope this helps.