-1

I am currently learning MVC 5 and am using the IDE Visual Studio, I am a complete beginner in MVC I do know C sharp to an decent level though.

The tutorial I am following has added a class to the model folder but when I tried to do so the button to add a class is grey so you cannot select it.

What do I do?

enter image description here

4
  • Questions that ask "where do I start" are typically too broad and are not a good fit for this site. People have their own method for approaching the problem and because of this there cannot be a correct answer. Give a good read over Where to Start, then address your post.
    – DavidG
    Nov 24, 2015 at 16:02
  • Quite unusual issue, could you provide the screenshot and give a little bit more info, otherwise as @DavidG said your question is too broad? Nov 24, 2015 at 16:02
  • Do you mean you right-clicked the project's Model folder, and there is no Add > Class available/enabled? Nov 24, 2015 at 16:04
  • 3
    Are you trying to do this while your project is still running?
    – DavidG
    Nov 24, 2015 at 16:10

2 Answers 2

8

The project was being debugged in Visual Studio. When the site is running in Visual Studio things like model classes, controllers, etc. cannot be added.

2
  • we already answered the question in the comments above so your answer wasn't necessary but is appreciated. Nov 26, 2015 at 10:07
  • 1
    @NafisRahman: This was posted as a community wiki, so the question would show has having been answered. I don't get any credit for it; it's just for the sake of keeping SO clean. In the future, if your comment answers the question, then post it as an answer, not a comment. Nov 30, 2015 at 15:17
1

Model classes cannot be added when the project on Visual studio is still debugging. Hence to add a model class, or make any changes you must click the stop debugging button.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.