问题
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!
回答1:
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.
回答2:
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.
来源:https://stackoverflow.com/questions/37196586/no-intellisense-in-asp-net-core