Can not add view to any controller in mvc 5 - c#

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.

Related

Hresult 0x80070003 - ASP.NET Web Aplication (.Net Framework) - Visual Studio 2022

This is my first post on stackoverflow because i don't see the solution anywhere.
The problem is, when i want to create a ASP.NET Web Aplication, this error appears. Please i need help, i'm sure this is a simple error but i can't make it works for start working in my proyect.
The proyect is created but that error makes dont work correctly.
The project creation parameters are as follows:
1)
https://i.stack.imgur.com/KwalH.png
2)
https://i.stack.imgur.com/yPHJx.png
And here the error:
https://i.stack.imgur.com/mi0gN.png
Thanks Lex Li for the reply.
From the project creation parameters you provided, the project location is in the OneDrive folder.
It is recommended that you create or use a normal folder to store the project and test again.
If the problem persists, please contact me again.
I would do a repair of the vs2022 install.
I am able to choose your options - works without issues.
So, go tools->get options and
close the first panel, and then choose this:

Web app showing different screen at visual studio and Azure

I am maintaining an app, developed by someone else who is not in the organization anymore.
And my skill with .net is very limited. (Can run and deploy the code.)
As you can see in the image, the same code and same database it works fine in visual studio, I can see the table with columns. But the deployed code in Azure is not showing the table.
Just want to check with experts here, if you see anything obvious missing here?
Just a bit of background about the above Table: It is a dynamic table, Admin can customize the table columns, width, etc.
Apologies for the silly question, but just trying if I can get a quick win by asking it here.
Cheers David
This could be due to a runtime issue, which occurs when the files in your wwwroot folder are precisely what they should be, but the site doesn't function correctly for some reason, such as a missing element, or it could be due to a change in how the page is viewed.
After you've deployed, check your Kudu Console to see if the View of the controller you're deploying has changed.
I tried reproducing the same and this is how I compared my Kudu Console.cshtml and VS Code.cshtml files.
Here is the output
When I ran in inspect mode found some of the .js files were showing 404 error.
Checked the visual studio and for some reason, those were not added to the project!!
So I had to manually include them in the project. After publishing it is now working fine.

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

adding view is disabled in VS 2015 MVC 5

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

VS Crashes with RAZOR VBHTML

For some reason, with the Razor view engine, VS is crashing on me. I copied the CSHTML content over to a VBHTML file and begin reformatting it, and VS has crashed on me twice now as I change a helper or function method syntax from:
#helper SomeHelper(string text)
to
#Helper SomeHelper(text As String)
Is anyone else getting this? The whole machine must be rebooted to get intellisense/markup highlighing to work.
Thanks.
If you are using Visual Studio 2010, I suggest that you install SP1. Support for Razor views is improved.
Link to Download
Link to Change list

Categories