0
votes

I am working on an existing Umbraco 8 project and seeing some very strange behaviour. I created a doctype via my localhost and it generated the doctype.generated.cs file added it to visual studio and everything was fine.

When it came to deploy the changes, I went into Model Builder regenerated the models, saw them appear in the folder, went to the page and got the error

The type or namespace named 'Blog' does not exist in the namespace 'Umbraco.Web.PublishedModels' (are you missing an assembly reference?)

I am running the model builder in AppData mode to a custom path so they are not hidden in the AppData folder.

I have tried restarting, changing the mode to PureLive and LiveAppData and still no joy

Any help would be greatly appreciated

2
Could you explain your environment setup and how you are deploying your site?wingyip
Originally it was setup as a virtual directory but it has now been moved to its own site in IIS, we deploy manually by copying files via FTPh1pm0n
So are you uploading the whole site through FTP when you deploy or just patching it? If patching, exactly what are you uploading? Also, is your local site sharing the same database as the live site or are you running 2 separate databases?wingyip
We are just uploading the files that changed, our local host and dev environment share the same database. When I load up the Dev site it says the models are out of date and to rebuild them. Sadly it doesn't fox the issue.h1pm0n

2 Answers

1
votes

One thing that always catches me out, if you are going to use AppData for your Model builder then you need to always copy across the project Dll's, I thought that just because I was updating views i didn't need to worry, how wrong I was.

Copy across your project Dlls and the error disappears

1
votes

BTW, you don't need to upload the model .cs files and you shouldn't generate them on the server if you share the database with dev. Only ever generate on dev and then push the dlls. You would only need the dlls since the models are compiled into the dll. Don't forget to build the project before you deploy the dlls though.

Also another thing that sometimes happens (but doesn't cause any errors) is that you accidentally upload the ood.flag file in published content models. If that file is present then models will always show as out of date.