Visual studio community 2015 breaking Umbraco projects
Hi all,
I have recently installed Visual Studio community edition 2015 on my second machine. I use mercurial for source management so have pulled the latest changes to my project down from bitbucket and restored the latest version onto my second machine.
Any external packages I manage via Nuget and these are all restored successfully on project rebuild. The rebuild succeeds.
However, if I then go to one of my views I experience the following problems.
On my main work machine running Visual Studio 2013 my view looks like this:
Nothing wrong here. However on my other machine running community 2015 I get this:
As you can see it highlights many of the IPublishedContent methods saying:
'IPublishedContent' does not contain a definition for
'GetPropertyValue' and no extension method 'GetPropertyValue'
accepting a first argument of type 'IPublishedContent' could be found.
It also greys out a number of my namespaces saying:
Using directive is unnecessary
Like I said, it compiles fine but according to intellisense these methods dont exist. I have even tried physically copying all of the files from one machine to another and using the project that way and I still have the same problem.
I have also tried clearing out the user settings using:
devenv.exe /resetuserdata
but this doesn't make and difference.
Does anyone know how to address this as it will have a serious effect on my team working together.
This is not the problem. The view file is included in the project. The problem here is Visual Studio 2015 is breaking something as we have tried pulling the solution down onto a machine with Visual studio 2013 community edition installed and that works fine.
As Gary says, include the .cshtml into your project. If it already is however, ensure you have added the Umbraco.Web namespace to the web.config file under the folder where your ShowBookingForm.cshtml resides.
I think most of you are misunderstanding. My view files are included in the project. My view files have the using statements appended to the top. This is not the issue. The issue is with Visual studio 2015 as the exact same solution in the exact same state opens fine in Visual studio 2013.
Well then this is strange, I too use VS Community 2015 and my umbraco projects work fine, all of them.
Your missing methods are all extension methods, located in the Umbraco.Web namespace, you have a using for that too?
I use the IPublishedContent.GetPropertyValue
Visual studio community 2015 breaking Umbraco projects
Hi all,
I have recently installed Visual Studio community edition 2015 on my second machine. I use mercurial for source management so have pulled the latest changes to my project down from bitbucket and restored the latest version onto my second machine.
Any external packages I manage via Nuget and these are all restored successfully on project rebuild. The rebuild succeeds.
However, if I then go to one of my views I experience the following problems.
On my main work machine running Visual Studio 2013 my view looks like this:
Nothing wrong here. However on my other machine running community 2015 I get this:
As you can see it highlights many of the IPublishedContent methods saying:
It also greys out a number of my namespaces saying:
Like I said, it compiles fine but according to intellisense these methods dont exist. I have even tried physically copying all of the files from one machine to another and using the project that way and I still have the same problem.
I have also tried clearing out the user settings using:
but this doesn't make and difference.
Does anyone know how to address this as it will have a serious effect on my team working together.
Hi Jason
If you include the view file in the project, you will get intellisense.
With file closed right click, include in project.
After you open it initially it can take a few seconds to appear.
Apologies if it sounds a bit like teaching granny to suck eggs, but if you include with view open, it does not update until you close and reopen.
Hope it helps
Gary
Hi Gary,
This is not the problem. The view file is included in the project. The problem here is Visual Studio 2015 is breaking something as we have tried pulling the solution down onto a machine with Visual studio 2013 community edition installed and that works fine.
Kind regards,
Jason Espin
Hi Jason,
As Gary says, include the .cshtml into your project. If it already is however, ensure you have added the Umbraco.Web namespace to the web.config file under the folder where your ShowBookingForm.cshtml resides.
It should look like this:
Alternatively you can add a using statement into your view, however the web.config's scope is all .cshtml file within the same folder.
In both cases as Gary said you have to reopen the cshtml file.
regards, Peter
Hi Jason
Am using VS2015 Community and have entered your first strings and have no issue, no error.
It is more likely a config issue, version issue, or asp.net version or MVC.
If you want to post anything I can compare it to mine if it helps.
Regards
Gary
I think most of you are misunderstanding. My view files are included in the project. My view files have the using statements appended to the top. This is not the issue. The issue is with Visual studio 2015 as the exact same solution in the exact same state opens fine in Visual studio 2013.
Well then this is strange, I too use VS Community 2015 and my umbraco projects work fine, all of them.
Your missing methods are all extension methods, located in the Umbraco.Web namespace, you have a using for that too? I use the IPublishedContent.GetPropertyValue
VS2015 does not support intellisense for any project less than .net 4.5, maybe that is the issue?
G
The project is .net 4.5
is working on a reply...