Modelsbuilder The type exists in both web.dll and temporary

Hey :slight_smile:

I just started a new 7.4.1 project where i want to use the new buildin Modelsbuilder. But im seeing a pattern of errors i cannot get by.

So in my web.config its set to PureLive so that the appData/Models is being populated.

In my visual studio project i have included the Models.generated som that I in my views can inherit something like :

@inherits Umbraco.Web.Mvc.UmbracoTemplatePage<ContentModels.Begivenhed>

This works like a charm :slight_smile: and its so frackin nice.

But when i then build my project and reloads a page it conflicts because its both in my web.dll(my web project is just named web) and also in my Models folder.

The error im getting is :

The type 'Umbraco.Web.PublishedContentModels.Forloeb' exists in both 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\d96a5e92\63a282db\assembly\dl3\9f27e43d\d7e6839f_cd73d101\Web.DLL' and 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\d96a5e92\63a282db\App_Web_all.generated.cs.8f9494c4.72tsgyk8.dll'

So i tried looking around and found out that i could set the ModelsBuilder to “Dll” mode in the web.config(i also removed the reference in my proj to the models folder) but now my views dosnt recognize the models.

Am i doing it wrong or ?


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/75519-modelsbuilder-the-type-exists-in-both-webdll-and-temporary