I downloaded a working MVC project to learn the actual MVC coding. On direct build, it gave me errors, I searched the net and as per suggestions I updated all the nuget packages and the other updates available. Now Razor is updated to 3.0, MVC to 5.2.3.0, Visual Studio to its latest version of VS 2012, and there is no intellisense anywhere on my project. I tried updating the web config with various values as suggested by users. I also tried updating the GUID. I created a fresh MVC 4 project and tried multiple times, but ended up updating the files and eventually back to Step 1. Its a hair pulling story now, as i cannot manage to get intellisense and all my work is stalled. Please help
This might do the trick for you
Tools->Options->Text Editor->C# (or All Languages)->General
and enable Auto List Members and Parameter Information in right hand side pane.
Related
I have an issue with the new Visual Studio 2017 when starting a new ASP.NET MVC project. Recently I started a course on Udemy:
https://www.udemy.com/the-complete-aspnet-mvc-5-course/learn/v4/content
In this course I obviously try to mimic the teacher as perfectly as possible. However, I bought a new laptop yesterday and installed VS2017 on it (apparently you cannot get VS2015 as easily anymore). I followed the same steps as with VS2015 on my previous laptop, but it seems that the files generated by VS2017 are less than those generated by VS2015. Two of the files I'm missing are:
Startup.cs
Models/IdentityModels.cs
And there are several more missing, for instance regarding the Account Managing. The files in VS2017 look like this:
VS2017 MVC generated files
Unfortunately I don't have a snippet of the VS2015 version, since I already reset my old laptop to factory settings.
Are there others with the same issue, or is this standard since VS2017? Right now I can just look at what the teacher does, but later on he will introduce logging in and authentication, at which point I assume I will need that Account Manager .cs file.
Any help is appreciated.
Thanks to itsme86 and Jasen I found the "issue". Just needed to put the authentication model to "Individual user accounts" when creating the project. Stupid error from my side.
I was using my own computer with VS 2015 installed in it. When I run / played my Index.cshtml, it would run into URL
http://localhost:xxxx/Controller/Index
and it would run fine.
But then after my company told me to use their computer with VS 2012 instead, When I run / played my Index.cshtml, it would run into URL
http://localhost:xxxx/Views/Controller/Index.cshtml, then it would show error about cant find the right path.
what am I missing in my project? I tried to remove and re-add System.Web.MVC into my references, but it still the same. I have spent a lot of time try to fix it, but cant find the answer yet.
Or do I need to install some add-on into my VS?
**EDIT
sorry if I make you misunderstand my question. My question is, how to make my VS 2012 can run into the same URL with my VS 2015 automatically. because right now, each time I run my project in VS 2012, I need to edit my URL manually so that it could run into the right path and URL
thank you
if you create mvc project on vs 2015 there is a possibility you create a MVC 5 project that not have built in support on vs 2012. you need to install the extension.
The stand alone installer is located here:
https://www.microsoft.com/en-us/download/details.aspx?id=41532
The release/installation notes can be found at
http://www.asp.net/visual-studio/overview/2012/aspnet-and-web-tools-20131-for-visual-studio-2012
Dependency:
.NET 4.5
Included:
MVC5
Entity Framework 6
Web API 2
Bootstrap
Razor
Nuget 2.7
Thank to #Fedri Qrueger that I able to find the answer. Even after Installing the extension, the problem still occurs.
the solution that I found is to edit to project.
Right click on project => properties => web
Then change start action from Current Page into Specific Page, and leave it blank. as it answered in here
While trying to build a web app using .NET Core, I used the Web App template and while everything works exactly as one would expect, the IntelliSense on .cshtml pages is extremely misleading. It doesn't recognize #ViewData, #model, or #Model tags, but when a view model is added or a ViewData message is used, the project compiles and runs as normal. However, IntelliSense marks them red like so...
... and says "Cannot resolve symbol" even when using Microsoft's own .NET Core web application template in a fully updated Visual Studio 2015, will all necessary NuGet packages installed. Does anyone know if this is a bug that needs to be fixed or there's a definitive checklist of NuGet packages to add? Adding various Mvc.Tooling and Tooling.Razer packages only enables tag helpers, but anything other than code after an # on a .cshtml file is still flagged as an error...
[SOLVED] Please see answer...
After deleting everything from C:\Users[me]\AppData\Local\Microsoft\Visual Studio and VSCommon, then running devenv /resetuserdata in the Visual Studio Command Prompt, singing back in, and restoring my environment, the issue resolved itself.
Still not sure whats wrong, but it seems too complex to me to figure out on my own without deeper knowledge of VS 2015...
After installing ASP.Net Core via Visual Studio ==> New Project ==> Web ==> ASP.Net Web Application ==> OK ==> ASP.Net 5 Templates. Restarted the system after the installation then create a new project of ASP.NET 5 Template ==> Empty website. I dont get any intellisense and all class names are in RED as if the Visual Studio or Resharper is unable to locate the definition.
Here are some screen shots.
and no intellisense
When using services object, I was expecting services.AddSingleton, service.AddScoped services.AddTransient service.AddLogging and so on...
I have restarted the visual studio but still the same result, however the project compiles and runs as expected but its very difficult to figure out the new api without any support from the intellisense.
I have resharper v 9 with update 1 installed.
Thanks!
I had the same issue with .NET Core and disabling Resharper worked for me. As soon as I disabled it, Intellisense in Razor views started working again.
It all depends what version of ASP.NET 5 you're using, as it's been a bit of a moving target to support. It should work, but for (I think) RC1 bits, but if you're trying to use the current pre-RC2 builds, there are known issues (e.g. the tooling has been completely rewritten). We're hoping to get things fixed and updated post RC2, but with the recent announcements about continuing breaking changes to the tooling (project.json is being phased out and replaced with .csproj files), this might not be so easy. We're going to have to wait and see how the RC2 tooling looks.
After having installed the Update 4, Visual Studio 2013 don't recognize everything related to MVC anymore and a lot of things are underlined in red.
Assemblies such as System.Web.Html.HtmlHelper or System.Web.Mvc are presents in warning messages, but my applications still runs.
The problem is that now, I can't add a new Controller or add a View to a Controller, and this is really problematic when I want for example to generate a Controller with Views using Entity Framework.
I have tried to relaunch the Update4.exe with "Repair" option.
I also have tried to unintsall and reinstall VS2013.
Please answer me if you have a solution.
It sounds like you became a victim of MS14-059 windows update. Make sure that you are referencing correct assemblies not from GAC but these that you downloaded via NuGet.