In my VS 2017 templates using @inherits Umbraco.Web.Mvc.UmbracoTemplatePage aren't doing intelisense or contextual formatting. But, on my @inherits Umbraco.Web.Mvc.UmbracoViewPage<IEnumerable<IPublishedContent>> it is doing both intelisense and contextual formatting. I just updated my VS 2017. Any ideas?
Home.cshtml has the option to "include in project" when I right-click in solution explorer. Ergo it must not be included. Home does not show intelisense or contextual formatting.
ncNewsPerspectiveGrid.cshtml also has the "include in project" option when I right-click in solution explorer. ncNewsPerspectiveGrid does show intelisense and contextual formatting.
That's the problem. It doesn't go for everything, but only views included in the project are actually part of the application (if I can say it like this). That's your problem. Always include your views.
Once you do, your intellisense will come up because then VS knows (oh shit those assemblies/namespaces whatever can be referenced here).
Cheers dude.
Edit: Nothing that is excluded from the project will be included when you hit 'Publish' in VS and select configuration mode as 'release'. That goes for Models, Controllers etc etc
TL;DR your clients are going to be very angry that they have a broken project.
Glad I could help man. Be careful with including everything as whatever you include in the project (Models, Controllers etc) will be compiled to dlls and that could cause problems with bigger projects.
A happy medium is to include only the things that you need
Umbraco *.cshtml in Visual Studio
In my VS 2017 templates using
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
aren't doing intelisense or contextual formatting. But, on my@inherits Umbraco.Web.Mvc.UmbracoViewPage<IEnumerable<IPublishedContent>>
it is doing both intelisense and contextual formatting. I just updated my VS 2017. Any ideas?How about UmbracoViewPage instead of UmbracoTemplatePage? In general as far as I know is to stop using UmbracoTemplatePage and use UmbravoViewPage
Changed it to UmbracoViewPage and still no intelisense or contextual formatting.
Hi BH
Do you use web application project or website?
All needed dlls are in bin folder?
Alex
I started with an empty web application.
I followed this guide when I started my project https://our.umbraco.com/documentation/getting-started/setup/install/install-umbraco-with-nuget
If you use web application - views should be included into project
The views are in my solution explorer in VS, just not getting the intelisense or contextual formatting on the viewpage.
Is, in the properties window, the build action "Content"?
Not sure.
This is not right I think. What kind of project have you? Sure this is a .net framework web application?
Hi bh,
Can you show me the view in VS?
Like this:
ProductPage in my case is included in the project and gives intellisense. SearchResults is not and doesn't.
Home.cshtml has the option to "include in project" when I right-click in solution explorer. Ergo it must not be included. Home does not show intelisense or contextual formatting.
ncNewsPerspectiveGrid.cshtml also has the "include in project" option when I right-click in solution explorer. ncNewsPerspectiveGrid does show intelisense and contextual formatting.
That's the problem. It doesn't go for everything, but only views included in the project are actually part of the application (if I can say it like this). That's your problem. Always include your views.
Once you do, your intellisense will come up because then VS knows (oh shit those assemblies/namespaces whatever can be referenced here).
Cheers dude.
Edit: Nothing that is excluded from the project will be included when you hit 'Publish' in VS and select configuration mode as 'release'. That goes for Models, Controllers etc etc
TL;DR your clients are going to be very angry that they have a broken project.
Including the file in the project did not rectify the intelisense and contextual formatting issue.
Try restarting VS. Is what you're trying to use also included? As in, your models etc?
BOOYAH! Thank you @HarrySpyrou ! I included EVERYTHING in my project, and restarted VS, and it's working. Thank you sir!
Glad I could help man. Be careful with including everything as whatever you include in the project (Models, Controllers etc) will be compiled to dlls and that could cause problems with bigger projects. A happy medium is to include only the things that you need
Cheers.
Thanks for the heads-up. I had to exclude the Obj/Debug and Models folders to get the project to build.
is working on a reply...