No intellisense in ASP.Net Core - c#

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.

Related

Missing ASP.NET Core Web Application Template and all ASP.Net Core Templates in Visual Studio 2019

I do have a very odd problem with Visual Studio 2019 (Professional version 16.9.2) when trying to create a new project with a ASP.NET Core Web Application template.
Although I have a a lot of templates available, my list of new project is desperately not showing the template, and none of ASP.Net Core ones (the ones with the little planet, a circle and a blue dot icon) this is the icon I don't have, it's not taken from my machine
My version of VS is up to date, I've installed the .NET Core cross-platform development my Visual Studio configuration
I've installed the .NET Core package (I tried with all versions).
No matter which option I'm chosing in the Update tool, I still have the same list of templates, it never changes.
I've reinstalled VS from scatch. I've tried on 4 different machines (1 physical machine, 1 virtual desktop and 2 servers). I've also tried from line command prompt by using dotnet new, but I do have exactly the same list then the one in VS.
I've also tried to change the templates location from my local profile folder to the C:\Program Files(x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\ProjectTemplates
But the templates list remains the same.
I'm out of ideas, sounds like I tried almost everything, for now I'm stuck!
If anyone among you has any idea or already had this issue, please let me know!
Thanks everyone for any help you could grant.
I finally found a way to have the 'missing' template. It seems that in VS 2019 the ASP.NET Core Web Application template has been replaced by the ASP.NET Core Empty.
I had to tweak it a little, but seems to be now Ok.
I hope this helps some folks
Install the ASP.NET and web development workload.
Visual Studio Installer -> Click on Modify -> Select ASP.NET and web development workload.

Intellisense not working in VS 2012

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.

.NET Core MVC 6 misleading IntelliSense

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...

Debugging is failing and project References missing on newest ASP.NET Core release

Using the newest ASP.NET Core release (i.e. RTM June 27), I cannot get the project to run normally in Debug. Also, the project References are blank and the Intellisense isn't working if I do F12/Go To Definition. The strange part is that it will compile fine and work as it should I go to command line and do 'dotnet run'.
I've tried uninstalling and reinstalling both the Tools and even VS 2015. I've run as Admin also with no luck. I've tried both creating a new empty web project and also using the samples at https://github.com/aspnet/cli-samples. Nothing seems to fix it.
My guess is that something isn't registered correctly in VS 2015. Whatever isn't correct seems to survive the uninstall/reinstall process.

Can't add Controller/View with MVC 5 after VS Update 4

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.

Categories