Copied to clipboard

Flag this post as spam?

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


  • Thomas Haggren 29 posts 149 karma points
    Dec 12, 2017 @ 14:12
    Thomas Haggren
    0

    ModelBuilder constantly failing in production

    Hi all

    I get this error constantly in production. The site works fine on my localhost and it used to work also in production. After a deploy it stopped.

    Any ideas on how to resolve this?

    Failed to build PureLive models. The type initializer for 'File' threw an exception.

    at Roslyn.Utilities.FileUtilities.OpenFileStream(String path) at Microsoft.CodeAnalysis.MetadataReference.CreateFromFile(String path, MetadataReferenceProperties properties, DocumentationProvider documentation) at Umbraco.ModelsBuilder.ReferencedAssemblies.<>c.<.cctor>b22(String x) in X:\Projects\Umbraco\ModelsBuilder\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\ReferencedAssemblies.cs:line 24 at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source) at Umbraco.ModelsBuilder.ReferencedAssemblies.<>c.<.cctor>b21() in X:\Projects\Umbraco\ModelsBuilder\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\ReferencedAssemblies.cs:line 23 at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue() at System.Lazy1.get_Value() at Umbraco.ModelsBuilder.ReferencedAssemblies.get_References() in X:\Projects\Umbraco\ModelsBuilder\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\ReferencedAssemblies.cs:line 37 at Umbraco.ModelsBuilder.Umbraco.PureLiveModelFactory.GenerateModelsCode(IDictionary2 ourFiles, IList`1 typeModels) in X:\Projects\Umbraco\ModelsBuilder\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\Umbraco\PureLiveModelFactory.cs:line 432 at Umbraco.ModelsBuilder.Umbraco.PureLiveModelFactory.GetModelsAssembly(Boolean forceRebuild) in X:\Projects\Umbraco\ModelsBuilder\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\Umbraco\PureLiveModelFactory.cs:line 370 at Umbraco.ModelsBuilder.Umbraco.PureLiveModelFactory.EnsureModels() in X:\Projects\Umbraco\ModelsBuilder\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\Umbraco\PureLiveModelFactory.cs:line 221

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Dec 12, 2017 @ 15:14
    Alex Skrypnyk
    0

    Hi Thomas

    Try to use Dll mode, I think it works nicely.

    THanks,

    Alex

  • Thomas Haggren 29 posts 149 karma points
    Dec 12, 2017 @ 16:23
    Thomas Haggren
    100

    Hi Alex

    Already tried that with no luck.

    Adding this to the web.config solved it:

    <dependentAssembly>
        <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> </dependentAssembly>
    

    For some reason only needed in production (Azure).

    Regards,

    Thomas

Please Sign in or register to post replies

Write your reply to:

Draft