adding view is disabled in VS 2015 MVC 5 - c#

I have a working MVC 5 web application. everything was ok until suddenlly i found out that i cannot add a view to the application and the add button is disabled.
I use VS 2015 Entrprise update 3 RC.
C# as a programming language.
the project type GUIDS tag looks like this
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
please help me with this.
Thanks all

Your ProjectTypeGuids look ok. You can view a list of ProjectTypeGuids here.
I have Visual Studio 2015 Community Edition here and it works fine when I try to add a View clicking on Views folder and an Action inside a Controller.
There are some similar questions here at stackoverflow, maybe they can help you:
Cannot add view to ASP.NET MVC 5 project
Visual Studio 2013 button to add a View is disabled
Can you give more information about how you are trying da add that View please?
Some tests
I can reproduce clicking on the Views folder and the add button is disabled if I choose Template: Empty and don't select any Model Class:
The only way the button Add will be enabled with no Model Class selected is if I choose Empty (Without Model):

Make sure you have all the following installed:
Modifying VS -> workloads -> installation details

Related

VS2017 How to create an Empty Web "Application"

I cannot find a way to create an Empty Web application in VS2017(ASP.NET WebForm).
In VS2015 there was a template for this.
Seems like VS2017 can only create Empty Web Site.
This is what I have :
==============================================
Update for the whoever see this post in future: I Ended up rebooting my computer AND VS2017 did some updates. After that, The Empty Template appeared! Clearly a VS 2017 bug.
Go to File > New Project
This will prompt you to the following Dialog where you choose for a Web App.
Then you will get to the point where you can choose a template

Visual studio 2015 no Basic page when adding new item?

So I want to start doing c# from head first c# 3rd edition, the big problem is that I can't find neither blank page and I saw alot of people saying that using WPF is okay, but when I try and add a new item I see nothing related to c# or what I actually need, what I need is a basic page, here is how it looks like:
now the problem is I can't fix it to show me what I need only for c# I tried, community,enterprise.
Does anyone have any idea of how to fix this?
You seem to be trying to add an item at the solution level. Note that in the screenshot it says "Add New Item - Solution Items". This will create files that exist in the solution, but no belong to any particular project, not affecting the output of compilation of any project. That's the reason why you don't see anything code related, you're not editing a code project.
Instead, right click on the project item on the solution explorer (not on the top solution item) and add a new item there. The selection of options will be specific to the type of code there. For example for WPF you'll get all XAML-based file types, or for Winforms you'll see forms and control classes.
I had this same problem I am using Visual studio 2015 community edition, the problem is you have created the wrong project to start of with. The screenshots in the book are from VS 2013 so it will look a little different.You need to create a Blank App(Universal windows 8.1) highlighted in the image attached and not Blank App(universal window). Once I done this basic page will no be available in the add new item page.
VS 2015 Screenshot

Can not add view to any controller in mvc 5

Hello everyone We have searched this error beforehand, but nothing seemed to be our case, since all of the problems that were mentioned were because of using EF Code first, that we are not using it.
After migrating to MVC5, we ran into a problem. Whenever we want to add a view to our controller, we get the following error:
there was an error running the selected code generator value cannot be null
BTW, we are using LINQ to SQL,and we are not scaffolding the view.
We have left the Template Empty(Without model), and we are not using layout page.
Our project is using ASPX view engine. We had no problem in VS 2012. After migrating to VS 2015 we are running into this problem.
Has ASPX view engine been removed from VS 2015. Could it be the problem?
Any kind of help would be highly appreciated.
If Prompt for
there was an error running the selected code generator values does
not fall selected range in visual studio
web.config has been deleted or renamed.
Please check your web.config file. Might be there were any additional tag would be added.
You can do this by doing the below method
All I had to do is install Web Essentials 2015.1 , restarted Visual Studio, repeated the Add View action, and it worked, don't have an explanation to this, but it worked.

Add MVC Controller Missing

In Visual Studio 2013, I am missing the add MVC Controller - Empty scaffolding item.
When I right click the controllers folder, then Add, and click the controller option at the top of the menu. The Add Scaffold popup window appears with only a list of Web API 2 controllers to add.
http://postimg.org/image/bz5rze56n/ <--- Image here
Just to see if it is only this project, I created a new empty mvc project and followed the same steps and I did have the mvc controllers in there.
Does anyone know how I can get those options back in my main project? I'd rather not just copy and paste my existing controllers. :-P
Thank you for any help you may provide!
I know this is an old topic, but I found if you instead of using the Add->Controller option in the context menu, but instead use Add->New Item option, then choose MVC Controller and name it, then this also creates the same structure as the Empty Controller template.
shut down all running Visual studio's
run VisualStudio command prompt as admin.
type this: devenv /installvstemplates

ASP.net MVC strongly typed view dropdownlist is empty

For a Sitecore7 solution I setup an ASP.net MVC3 project. I'm trying to add a new view to my controller action using the "Add view" wizard, by clicking right on the View() code > Add view.
public class HomeController : SitecoreController
{
public ActionResult Add()
{
return View();
}
}
The "Add view" wizard shows up, but when I checked the checkbox "Create a strongly-typed view" the Model class dropdownlist is empty.
There are no build errors. However I cleaned, build and rebuild the solution, but that doesn't fix the problem. I'm using Visual Studio 2012 and the enviroment is completely updated.
I searched the internet and found this simular looking issue, but the solution doesn't fix the problem.
I have tried to fix it in a day, without success. Does anyone know a solution?
Thanks a lot.
Jordy
You can just type in the model at the top of your view, like this:
#model your.namespace.goes.here
1.FIRST YOU DELETE ALL FILES IN YOUR APPLICATION BIN FOLDER.THEN TRY BUILD THE APPLICATION. OR
2.DO THE FIRST STEP AND IF YOU ARE USING EF TRY TO UPDATE YOUR DATABASE BY TYPING "update-database" from your package manager console
The simplest way to add a strongly-typed View is:
right click your Views folder -> Add -> Scaffold item -> MVC view
From there you can select whatever model and type you have available in the project. However, keep in mind that old MVC templates (like MVC 3) might not have all options available.

Categories