Umbraco ModelsBuilder v3 with Umbraco v7.5.2: More that one type want to be a model for content type File
Hi, I have been developing a website for some time without using Umbraco ModelsBuilder. I have created a couple of my own models in the /Models folder: ContactModel for the custom contact form and ShowcaseProductModel for my product card. Everything went while I was developing the website in one language. Yesterday, I decided to freeze the development of the features and add two other languages using Vorto.
So, I have studied the ModelsBuilder Wiki and have read and watched some youtube videos of Jeroen Breuer on Vorto. I liked his idea to use the Umbraco.ModelsBuilder.Api to generate models inside my /Models folder instead of inside /App_Data and/or /bin. So, I configured ModelsBuilder in the Web.config
Immediately, I got a compilation error as my IIS Express of the Visual Studio 2015 was not running yet and there was nothing listening on port 19617. So I hit Ctrl-F5. It opened my website and I could browse it as well as my Umbraco backend.
Back to models generation. Right clicked the Paraplu.cs file and then Run Custom Tool. I could see the model classes being generated. I have refreshed the cache in the browser and everything seemed still to be working. But I know that one can only be for 100% sure if the Visual Studio is completely restarted. So I did.
When I opened the solution again and hit Ctrl-F5 again, it threw this error at me even before I saw the website:
The error was thrown from ModelsBuilderApplication at line 32 (the long line on the error stack trace below ModelsBuilderApplication at line 55:
if (config.EnableFactory)
InstallDefaultModelsFactory();
I have tried a lot of things as a workaround but each time it came back to this one error message.
I wonder if it has anything to do with the fact that I have already had 2 (not generated) models before triggering the ModelsBuilder.
Oh yeah, I have forgotten to mention. I tried to comment out File. Then it started complaining about Folder, which stands next in the list of generated models.
Hi Ken, good to know. I have not found your fix and went an alternative way. But it would be nice to try it again and see if it works for me as well. Thanks man. :)
Umbraco ModelsBuilder v3 with Umbraco v7.5.2: More that one type want to be a model for content type File
Hi, I have been developing a website for some time without using
Umbraco ModelsBuilder
. I have created a couple of my own models in the/Models
folder:ContactModel
for the custom contact form andShowcaseProductModel
for my product card. Everything went while I was developing the website in one language. Yesterday, I decided to freeze the development of the features and add two other languages usingVorto
.So, I have studied the
ModelsBuilder Wiki
and have read and watched some youtube videos of Jeroen Breuer onVorto
. I liked his idea to use theUmbraco.ModelsBuilder.Api
to generate models inside my/Models
folder instead of inside/App_Data
and/or/bin
. So, I configuredModelsBuilder
in theWeb.config
I added a dummy
Paraplu.cs
class inside/Models
, installed theModelsBuilder Custom Tool
and configured theProperties of the
Paraplu.cs` to use it:I have also added
.user
file with the same name as the solutioned4u.UmbracoModelsBuilder.user
:Immediately, I got a compilation error as my
IIS Express
of theVisual Studio 2015
was not running yet and there was nothing listening on port 19617. So I hitCtrl-F5
. It opened my website and I could browse it as well as myUmbraco backend
.Back to models generation. Right clicked the
Paraplu.cs
file and thenRun Custom Tool
. I could see the model classes being generated. I have refreshed the cache in the browser and everything seemed still to be working. But I know that one can only be for 100% sure if the Visual Studio is completely restarted. So I did.When I opened the solution again and hit
Ctrl-F5
again, it threw this error at me even before I saw the website:The error was thrown from
ModelsBuilderApplication at line 32
(the long line on the error stack trace belowModelsBuilderApplication at line 55
:I have tried a lot of things as a workaround but each time it came back to this one error message.
I wonder if it has anything to do with the fact that I have already had 2 (not generated) models before triggering the ModelsBuilder.
Oh yeah, I have forgotten to mention. I tried to comment out File. Then it started complaining about Folder, which stands next in the list of generated models.
Hi, I think I have the same error. Did you manage to solve this?
Ah, figured it out. I shouldn't include the generated files in my solution...
Hi Ken, good to know. I have not found your fix and went an alternative way. But it would be nice to try it again and see if it works for me as well. Thanks man. :)
is working on a reply...