What is missing here when trying to access GetPropertyValue?
I've just atrted a new project and a clean slate with project setup but got an issue in the extentions project (my project for views etc that i want under source control).
The umbraco site is v 6.1.1 And i have referenced the Core, cms, umbraco, interfaces, macroengine dll's trying to see if it was something from them and still no joy! :(
My external project views are not picking up the .GetpropertyValue or AnscestorOrSelf and i assume these are extension methods and I am missing a namespace somewhere.
The error is:
'Umbraco.Core.Models.IPublishedContent' does not contain a definition for 'GetPropertyValue
Its probably something missing from the web.config either in the root or the views folder... but what!???
Looked at a few instances of where others having siilar problem with the namespace not importing from the views web.config and some people say resatrting visual studio works and it picks up the namespaces but its not happening in my project.
Unless i add the namespaces to the individual views it doesnt work correctly.
Looks like a Visual Stuio bug in intellisense. Files work ok in Umbraco site - just th eintellisense aint picking it up so to get this working just add the using imports to the top of the View for now. Pain in the butt but its a workaround.
Just to add - i ended up having other issues with my environment. Restarting Visual Studio didnt cut it so a full machine restart seems to have fixed everything and i no longer need the namesapce imports in the views!
I'm having the same problen and a full machine restart also didn't help. Did you find something else which could be the problem? I'm using Visual Studio Express 2012 for Web.
It was all down to the namespaces and the fact VS wasnt loading them into intellisense when they were declared in the Views web.config.
First add the namespace imports at the top of the view file - that should give you the intellisense. At this point i couldnt get my head around why the imports werent getting picked up from the views web config. This is where a machine restart fixed it and i was able to remove the imports from the views.
Do you get the intellisense etc when you add the imports at the top of the view?
Yes the intellisense works when I add the imports at the the top. So a machine restart after that should fix it and than I can remove the imports again?
As an aside - One project i had I also needed to add in the section declarations used int the views web.config to the base web.config (as i was using a stripped down config) - but you should get an error for this if they weren't in there.
What is missing here when trying to access GetPropertyValue?
I've just atrted a new project and a clean slate with project setup but got an issue in the extentions project (my project for views etc that i want under source control).
The umbraco site is v 6.1.1 And i have referenced the Core, cms, umbraco, interfaces, macroengine dll's trying to see if it was something from them and still no joy! :(
My external project views are not picking up the .GetpropertyValue or AnscestorOrSelf and i assume these are extension methods and I am missing a namespace somewhere.
The error is:
'Umbraco.Core.Models.IPublishedContent' does not contain a definition for 'GetPropertyValue
Its probably something missing from the web.config either in the root or the views folder... but what!???
Ok got a bit further with this.
The extensions are in the Umbraco.Web namespace. If i import this namespace to the view then it works.
My next question is why is this not getting picked up from the web.config in the views folder as this namespace is added:
Looked at a few instances of where others having siilar problem with the namespace not importing from the views web.config and some people say resatrting visual studio works and it picks up the namespaces but its not happening in my project.
Unless i add the namespaces to the individual views it doesnt work correctly.
Anyone know what the issue is?
Looks like a Visual Stuio bug in intellisense. Files work ok in Umbraco site - just th eintellisense aint picking it up so to get this working just add the using imports to the top of the View for now. Pain in the butt but its a workaround.
Just to add - i ended up having other issues with my environment. Restarting Visual Studio didnt cut it so a full machine restart seems to have fixed everything and i no longer need the namesapce imports in the views!
Hi Damian,
I'm having the same problen and a full machine restart also didn't help. Did you find something else which could be the problem? I'm using Visual Studio Express 2012 for Web.
Jeroen
Hi Jeroen,
It was all down to the namespaces and the fact VS wasnt loading them into intellisense when they were declared in the Views web.config.
First add the namespace imports at the top of the view file - that should give you the intellisense. At this point i couldnt get my head around why the imports werent getting picked up from the views web config. This is where a machine restart fixed it and i was able to remove the imports from the views.
Do you get the intellisense etc when you add the imports at the top of the view?
Yes the intellisense works when I add the imports at the the top. So a machine restart after that should fix it and than I can remove the imports again?
Jeroen
It did for me.
Not had an issue since.
As an aside - One project i had I also needed to add in the section declarations used int the views web.config to the base web.config (as i was using a stripped down config) - but you should get an error for this if they weren't in there.
is working on a reply...