The type or namespace name 'Test' does not exist in the namespace 'Umbraco.Web.PublishedModels'
Hello,
I'm using Umbraco 8 and Umbraco Model Builder v8.1.0.
Since I've installed the Model Builder, every time I create content (page) I get the below error when visiting this page.
The type or namespace name 'Test' does not exist in the namespace 'Umbraco.Web.PublishedModels' (are you missing an assembly reference?)
tells Umbraco that the view is going to use a custom model called 'Test' and this is automatically generated by Modelsbuilder.
if you are not using ModelsBuilder then you can change this to be
@inherits Umbraco.Web.Mvc.UmbracoViewPage
and you can write out properties using the syntax
@Model.Value("title")
If you want to use 'ModelsBuilder' then whether you get this error or not will depend on where you are generating your models, and whether or not you have a Document Type called Test, and whether this is being generated correctly and in the ContentModels namespace... to somewhere...
From your config it looks like you are using Api mode to generate the Models...
There is some useful info on this page on how to setup ApiMode:
The type or namespace name 'Test' does not exist in the namespace 'Umbraco.Web.PublishedModels'
Hello, I'm using Umbraco 8 and Umbraco Model Builder v8.1.0. Since I've installed the Model Builder, every time I create content (page) I get the below error when visiting this page.
EX: Document Type: "Test"
Template:
Content: "Test Page"
And I get this error when visiting the page:
Config file:
Can anyone help? Thank you.
Hi Ion
this line here:
tells Umbraco that the view is going to use a custom model called 'Test' and this is automatically generated by Modelsbuilder.
if you are not using ModelsBuilder then you can change this to be
and you can write out properties using the syntax
If you want to use 'ModelsBuilder' then whether you get this error or not will depend on where you are generating your models, and whether or not you have a Document Type called Test, and whether this is being generated correctly and in the ContentModels namespace... to somewhere...
From your config it looks like you are using Api mode to generate the Models...
There is some useful info on this page on how to setup ApiMode:
https://github.com/zpqrtbnk/Zbu.ModelsBuilder/wiki/Builder-Modes
regards
Marc
Thank you for a great reply!
I'm using API ModelBuilder
adding the right namespace to the template solved the issue.
Do you know, how do I display the model's properties? If I have a title property on the test document type, how do I display its value on the page?
Thank you.
I've tried
@Model.{propertyName}
That returns:
How do I render this ?
Solved, the property is a grid layout, had to use: property alias is - "content"
Thank you all for your help!
is working on a reply...