3

I am using Visual Studio 2019 with the latest release of the Core framework. I am creating a new Core MVC app against the Core Framework version 3.1. I have a controller and an action method. I want to create a new view. I am 'Empty' Razor View scaffolded item option. However, I get an error message as follows:

Files and Folders Cannot be

  • Empty Strings
  • System reserved names, including 'CON, 'AUX', 'PRN', 'COM1', or 'LPT2'
  • contain only '.'
  • have any of the following characters / ? : & \ | # %

Visual Studio Error Message when creating Empty View

The error occurs when selecting the option to add the view and before I ever get the dialogue box asking for the view's name.

Any ideas why I am getting this message?

3
  • 'The error occurs when selecting the option to add the view'? Which option you select? Where is the Option you mentioned? Commented Feb 6, 2021 at 7:09
  • @m.r226 When I click 'add view' I get a dialogue window presenting two options: the first is 'Razor View - Empty' and the other is 'Razor View.' I am trying to create an empty view. Commented Feb 7, 2021 at 15:55
  • Any luck on this one? As I get the same error. Commented May 24, 2021 at 22:22

1 Answer 1

6

I had the same problem. After some investigation I realized that my project folder path had a '#' in it (option 4 in the list of errors above). I created the project with a new folder path (e.g. in the c:/somepath/repos folder), which solved the error.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, indeed I had my project in the directory containing # in the path. Moving the project to new directory solved the issue. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.