Generated model classes can't find related interfaces
Hey Guys,
I am facing some strange issues with my published models by the models builder in my project. builder mode is set to AppData and models are generated. I also included the models folder and the models into the project.
I ran to this issue, after I could not use the generated models in my razor views, although I was referencing to the Umbraco.Web.PublishedModels as it is set as the namespace for the generated models. Then I took a look at the generated classes and saw that it some model classes do not find the namespaces of the composition document type models:
although those classes and interfaces do exist:
So I would then expect that building the web project failes due to these errors, but it does not:
seems like those model classes are not getting compiled by the solution and getting ignored from the build process.
I also removed the implementation of the interfaces, to just not having any errors for the post model class for instance, built the application and it is still not available in the razor view:
if you have any suggestions, why this is happening, it would be great to share. It's driving me nuts...
I found out that the issue was caused by the visual studio project type which was a web site project. after a painful process i managed to convert the web site project into a web application project in visual studio, and the generated models in the app_data folder are now compiled and working well also in views.
the model builder appdata mode doesn't work properly in a visual studio web site project.
Generated model classes can't find related interfaces
Hey Guys,
I am facing some strange issues with my published models by the models builder in my project. builder mode is set to AppData and models are generated. I also included the models folder and the models into the project.
I ran to this issue, after I could not use the generated models in my razor views, although I was referencing to the Umbraco.Web.PublishedModels as it is set as the namespace for the generated models. Then I took a look at the generated classes and saw that it some model classes do not find the namespaces of the composition document type models:
although those classes and interfaces do exist:
So I would then expect that building the web project failes due to these errors, but it does not:
seems like those model classes are not getting compiled by the solution and getting ignored from the build process.
I also removed the implementation of the interfaces, to just not having any errors for the post model class for instance, built the application and it is still not available in the razor view:
if you have any suggestions, why this is happening, it would be great to share. It's driving me nuts...
thanks
dee
Hi,
Is it giving an error when it is rendering that View? It could just be a Intellisense issue?
-Joep
I found out that the issue was caused by the visual studio project type which was a web site project. after a painful process i managed to convert the web site project into a web application project in visual studio, and the generated models in the app_data folder are now compiled and working well also in views.
the model builder appdata mode doesn't work properly in a visual studio web site project.
is working on a reply...