I have a solution within Visual Studio 2017. I can create new files etc and the intellisense works fine as expected. However, if i run the solution and create a new partial view. Opening that new PV in VS then does not allow intellisense on the code apart from the html part of the view, the same happens with Macro Partial Views.
Can someone help me understand if this is user error or just general expected behavior?
I created a blank solution with a .NET Application within that solution. I do have to "Show All Files" for the Partial Views and Macro Partial views to be view able.
But, you have to right click on the partials and macro partials and tell them to be included in the project each time they are created (which can be a bit tedious when using this approach).
Others like to use a WebSite project instead of Web Application project in visual studio because you don't have to add files to the project in the same way.
I've never had great luck with the Intellisense on razor files. Usually restarting Visual Studio gives it a good enough kickstart to start working again, but it's never consistent.
Creating Views in Back Office and Intellisense
Hi,
I have a solution within Visual Studio 2017. I can create new files etc and the intellisense works fine as expected. However, if i run the solution and create a new partial view. Opening that new PV in VS then does not allow intellisense on the code apart from the html part of the view, the same happens with Macro Partial Views.
Can someone help me understand if this is user error or just general expected behavior?
Thank you :)
Kind Regards,
Hi Gary,
How is your website set up? Is it a website project in Visual Studio, or a Web Application project in Visual Studio?
I've found that I have to include the view files into my project, close them and re-open them for Intellisense to kick in properly.
Nik
Hi Nik,
I created a blank solution with a .NET Application within that solution. I do have to "Show All Files" for the Partial Views and Macro Partial views to be view able.
Is there a better way to do this?
Kind Regards,
Gary Henshall
Hi Gary,
This is normally the approach I use:
https://our.umbraco.com/documentation/Getting-Started/Setup/Install/install-umbraco-with-nuget
But, you have to right click on the partials and macro partials and tell them to be included in the project each time they are created (which can be a bit tedious when using this approach).
Others like to use a WebSite project instead of Web Application project in visual studio because you don't have to add files to the project in the same way.
Nik
Cheers Nik. Including the files to my project worked a treat!
Thank you :)
I've never had great luck with the Intellisense on razor files. Usually restarting Visual Studio gives it a good enough kickstart to start working again, but it's never consistent.
Following Nik's solution of Right Clicking the individual templates and select "Include in Project" worked a treat for me! :)
Happy to help :-) Pleased you managed to get it working.
is working on a reply...