Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • James Inger 11 posts 102 karma points
    Nov 08, 2018 @ 01:09
    James Inger

    Model Builder not working

    HI ALl,

    I created a document type and then generated the Models (dll mode).

    I then altered the locked name of the document and generated the models again.

    Now there is always an error, and cannot create any more document types.

    Error as below for Model Builder

    Failed to build models.
    } expected
    at Umbraco.ModelsBuilder.Building.Compiler.ThrowExceptionFromDiagnostic(String path, String code, Diagnostic diagnostic)
    at Umbraco.ModelsBuilder.Building.Compiler.<>c__DisplayClass12_0.<GetCompilation>b__0(KeyValuePair`2 x)
    at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
    at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
    at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
    at Umbraco.ModelsBuilder.Building.Compiler.GetCompilation(StringassemblyName, IDictionary`2 files, SyntaxTree[]& trees)
    at Umbraco.ModelsBuilder.Building.CodeParser.Parse(IDictionary`2 files, IEnumerable`1 references)
    at Umbraco.ModelsBuilder.Umbraco.ModelsBuilderBackOfficeController.GenerateModels(String modelsDirectory, String bin)
    at Umbraco.ModelsBuilder.Umbraco.ModelsBuilderBackOfficeController.BuildModels()

    Any help would be awesome

    What file do I have to edit to fix the problem ??

    Is there anyway to manually generate the Models ???

  • Nik 1091 posts 4547 karma points MVP 2x c-trib
    Nov 08, 2018 @ 08:59

    Hi James,

    This is one of those unhelpful error messages but I think the issue is the version of C# models builder is trying to use.

    If you add this to your App Settings in web.config it might resolve the issue:

    <add key="Umbraco.ModelsBuilder.LanguageVersion" value="CSharp6" />


  • James Inger 11 posts 102 karma points
    Nov 08, 2018 @ 21:20
    James Inger

    Thanks for that - But that did not work

    I also have an error as below

    public class _Page_Views_MainPage_cshtml : Umbraco.Web.Mvc.UmbracoTemplatePage<ContentModels.MainPage> {

    Is there a way to fix this manually ??

  • MuirisOG 371 posts 1259 karma points
    Nov 08, 2018 @ 10:07

    What new name have you given the document type?

    I believe the underscore character may cause problems.

Please Sign in or register to post replies

Write your reply to: