So I've been working on a website on my local machine, everything is working perfect.
However I've now uploaded it to a VPS and published all the files and now I keep getting the following error;
The model item passed into the dictionary is of type
'Umbraco.Web.Models.RenderModel1[Umbraco.Web.PublishedContentModels.Home]',
but this dictionary requires a model item of type
'System.Collections.Generic.IEnumerable1[Cogworks.Meganav.Models.MeganavItem]'.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The model item
passed into the dictionary is of type
'Umbraco.Web.Models.RenderModel1[Umbraco.Web.PublishedContentModels.Home]',
but this dictionary requires a model item of type
'System.Collections.Generic.IEnumerable1[Cogworks.Meganav.Models.MeganavItem]'.
Source Error:
Line 32: @{ Line 33: var homeNode =
Model.Content.Site().OfType
I'm not sure whats going on as it works fine on my local machine?
I changed Modelsbuilder mode to Dll and generated the models but still no joy, I'll try make contact with with my VPS provider and see if its an issue with security.
Although my host EUKhost was recommended by this forum by a few people so I would hope that it shouldn't have any issues
I had a phone cal from Eukhost this morning who said they get the same error when they moved the website to shared hosting and insist that its a code issue rather then a server.....
I just find it hard to believe when it works on my local host and 1&1
Umbraco error on published files
Hello all,
So I've been working on a website on my local machine, everything is working perfect.
However I've now uploaded it to a VPS and published all the files and now I keep getting the following error;
I'm not sure whats going on as it works fine on my local machine?
Thanks
Anyone got an ideas what I'm missing??
Hi Matt,
It looks like you are using Models builder and something is wrong with your generated models.
Can you have a look in the developer section and go to the models builder dashboard and see how it is configured.
Dave
Hello Dave,
Thanks for reply here is my models builder dashboard;
ModelsBuilder is enabled, with the following configuration
•The models factory is enabled.
•The API is neither installed nor enabled. External tools such as Visual Studio cannot use the API.
•PureLive models are enabled.
•Models namespace is Umbraco.Web.PublishedContentModels.
•Static mixin getters are enabled. The pattern for getters is "Get{0}".
•Tracking of out-of-date models is not enabled.
Hi Matt,
I think it has to do with security settings on your VPS.
Modelsbuilders in PureLive mode needs to be able to run the roslyn compiler (the exe files in \bin\roslyn)
What you can on your local machine is change the Modelsbuilder mode to "Dll" in the web.config file.
After that go in Modelsbuilders dashboard again and click the "Generate Models" button.
After that transfer your local bin folder and web.config (or change the one on the vps) to your VPS machine.
Dave
Hello Dave,
I changed Modelsbuilder mode to Dll and generated the models but still no joy, I'll try make contact with with my VPS provider and see if its an issue with security.
Although my host EUKhost was recommended by this forum by a few people so I would hope that it shouldn't have any issues
Hello Dave,
I made those changes but still no joy.
They are saying that the VPS is setup correctly.
Do you have any other suggestions?
Thanks
Hi Matt,
Can you maybe post some code of your template ?
Dave
Hello Dave,
This is my parctial view, if I remove it from my master template the website will load fine (Although then I wont have a navigation)
And here is my navigation partial
Hello all,
Any ideas? I may have to remove the meganav and look at something else. Although its just strange how it works on my localhost.....
Thanks
Hi Matt,
No Ideas really
Maybe not everything got pushed to your VPS correctly.
Dave
Hmm cheers Dave,
Its really frustration why it doesn't work.
Works fine on local host and on 1&1 hosting. But does not work on EukHostvps
I had a phone cal from Eukhost this morning who said they get the same error when they moved the website to shared hosting and insist that its a code issue rather then a server.....
I just find it hard to believe when it works on my local host and 1&1
Hi Matt,
To me it seems like a permission issue
Have you tried all the healthchecks in the developer dashboard to see if anything is not set up correctly.
Dave
is working on a reply...