1

When I try to create controller using .NET cli codegenerator in my ASP.NET web mvc project:

dotnet aspnet-codegenerator --project . controller  -name "Controllers\TempController"

getting this error:

enter image description here

(Controller name contains '\').

So where is my mistake?

1
  • Hello Did you try the solution provided? Did you have a chance to look at this official document? Commented Jul 13, 2022 at 2:35

1 Answer 1

3

I presume you have put the "Controllers"-part in the name-parameter since you want it in the Controllers-folder. Use -outDir-parameter for the folder:

dotnet aspnet-codegenerator --project . controller  -name "TempController" -outDir "Controllers"

See documentation: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/tools/dotnet-aspnet-codegenerator?view=aspnetcore-6.0

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

Comments

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.