Error on adding new property to document type (uSiteBuilder)
Hello all
I'm new to Umbraco and Vega uSiteBuilder.
I'd like to know how to add a new property to an existing document type.
I actually added a new property of type "ContentPicker" to the document type class, but running the project is goes into an "object reference not set to an instance of an object" error on runtime.
Can anyone help me please?
uhm
Umbraco 7.6.4
uSiteBuilder works partially, so I had to add the contentpicker directly inside the administration of umbraco while I can keep the textstring properties inside the code.
Is there some other way to create a document type in code-first mode?
If you are using uSiteBuilder for having your doctypes generated on deploy to another environment have a look at uSync
This tool saves all configuration to xml files that you can deploy to another environment and can be imported there.
Also in my opinion using the doctype editor let's me create doctypes much faster than coding c# classes and decorating the properties with attributes.
Error on adding new property to document type (uSiteBuilder)
Hello all I'm new to Umbraco and Vega uSiteBuilder. I'd like to know how to add a new property to an existing document type. I actually added a new property of type "ContentPicker" to the document type class, but running the project is goes into an "object reference not set to an instance of an object" error on runtime. Can anyone help me please?
Hi Claudio
What version of Umbraco are you using?
uSiteBuilder isn't working with latest Umbraco.
Thanks,
Alex
uhm Umbraco 7.6.4 uSiteBuilder works partially, so I had to add the contentpicker directly inside the administration of umbraco while I can keep the textstring properties inside the code. Is there some other way to create a document type in code-first mode?
Hi Claudio,
My suggestion is to ditch uSiteBuilder. I has been proven time after time that there is no Code First framework that works correctly with Umbraco.
If you want strongly typed models this is already supported by Umbraco Models builder which was introduced in 7.4
I wrote an article about getting started with Models builder : https://24days.in/umbraco-cms/2016/getting-started-with-modelsbuilder/
If you are using uSiteBuilder for having your doctypes generated on deploy to another environment have a look at uSync This tool saves all configuration to xml files that you can deploy to another environment and can be imported there.
Also in my opinion using the doctype editor let's me create doctypes much faster than coding c# classes and decorating the properties with attributes.
Here are some articles on why code first should not be used : https://www.zpqrtbnk.net/posts/codefirst-post-mortem https://offroadcode.com/journal/news/the-code-first-in-umbraco-deadend/
Here are also some video's from the legendary Pete Duncanson explaining why code first is a bad thing : UK Fest 14 : https://www.youtube.com/watch?v=Hr1irQ0h5J8 uHangout : http://uhangout.co.uk/videos/ep032-with-pete-duncanson-the-ugly-chat-about-code-first-frameworks/
Dave
Thank you very much Dave, I'll read those articles and try to use your approach
is working on a reply...