Copied to clipboard

Flag this post as spam?

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


  • Richard Eyres 98 posts 580 karma points
    Mar 17, 2015 @ 17:02
    Richard Eyres
    0

    Error using ZbuModelsBuilder 2.1.1.

    I am just upgraded my project to use the latest version of the zbuModelsBuilder facility to 2.1.1. (both within VS and the application). Rebuilt the application and am getting the following error. Am i missing something? Have used the builder in the past without an issue before.

     

    ZbuModelsBuilder: ZbuModelsBuilder failed to generate code: Exception: Response status code does not indicate success (InternalServerError)

    {"Message":"An error has occurred.","ExceptionMessage":"Common Language Runtime detected an invalid program.","ExceptionType":"System.InvalidProgramException","StackTrace":"   at System.Collections.Immutable.SecurePooledObject`1.Use[TCaller](TCaller& caller)\r\n   at System.Collections.Immutable.SortedInt32KeyNode`1.Enumerator.PushLeft(SortedInt32KeyNode`1 node)\r\n   at System.Collections.Immutable.SortedInt32KeyNode`1.Enumerator..ctor(SortedInt32KeyNode`1 root)\r\n   at System.Collections.Immutable.ImmutableDictionary`2.Enumerator..ctor(SortedInt32KeyNode`1 root, Builder builder)\r\n   at System.Collections.Immutable.ImmutableDictionary`2.GetEnumerator()\r\n   at System.Collections.Immutable.ImmutableDictionary`2.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.CopyTo(KeyValuePair`2[] array, Int32 arrayIndex)\r\n   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)\r\n   at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext()\r\n   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()\r\n   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)\r\n   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)\r\n   at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)\r\n   at Microsoft.CodeAnalysis.CSharp.DeclarationTable.Cache.<>c__DisplayClass0.<_ctor>b__1()\r\n   at System.Lazy`1.CreateValue()\r\n   at System.Lazy`1.LazyInitValue()\r\n   at Microsoft.CodeAnalysis.CSharp.DeclarationTable.Cache.<_ctor>b__4()\r\n   at System.Lazy`1.CreateValue()\r\n   at System.Lazy`1.LazyInitValue()\r\n   at System.Lazy`1.get_Value()\r\n   at Microsoft.CodeAnalysis.CSharp.DeclarationTable.GetMergedReferenceDirectives()\r\n   at System.Lazy`1.CreateValue()\r\n   at System.Lazy`1.LazyInitValue()\r\n   at Microsoft.CodeAnalysis.CSharp.DeclarationTable.get_ReferenceDirectives()\r\n   at Microsoft.CodeAnalysis.CommonReferenceManager`2.GetCompilationReferences(TCompilation compilation, DiagnosticBag diagnostics, ImmutableArray`1& references, IDictionary`2& boundReferenceDirectives, ImmutableArray`1& referenceDirectiveLocations)\r\n   at Microsoft.CodeAnalysis.CommonReferenceManager`2.ResolveMetadataReferences(TCompilation compilation, ImmutableArray`1& references, IDictionary`2& boundReferenceDirectiveMap, ImmutableArray`1& boundReferenceDirectives, ImmutableArray`1& assemblies, ImmutableArray`1& modules, DiagnosticBag diagnostics)\r\n   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.ReferenceManager.CreateAndSetSourceAssemblyFullBind(CSharpCompilation compilation)\r\n   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.ReferenceManager.CreateSourceAssemblyForCompilation(CSharpCompilation compilation)\r\n   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.get_SourceAssembly()\r\n   at Microsoft.CodeAnalysis.CSharp.SyntaxTreeSemanticModel.GetDeclaredNamespace(NamespaceDeclarationSyntax declarationSyntax)\r\n   at Microsoft.CodeAnalysis.CSharp.SyntaxTreeSemanticModel.GetDeclaredNamespaceOrType(CSharpSyntaxNode declarationSyntax)\r\n   at Microsoft.CodeAnalysis.CSharp.SyntaxTreeSemanticModel.GetDeclaredTypeMemberContainer(CSharpSyntaxNode memberDeclaration)\r\n   at Microsoft.CodeAnalysis.CSharp.SyntaxTreeSemanticModel.GetDeclaredSymbol(BaseTypeDeclarationSyntax declarationSyntax, CancellationToken cancellationToken)\r\n   at Zbu.ModelsBuilder.Building.CodeParser.<>c__DisplayClass8.<Parse>b__0(ClassDeclarationSyntax x)\r\n   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()\r\n   at Zbu.ModelsBuilder.Building.CodeParser.Parse(ParseResult disco, CSharpCompilation compilation, SyntaxTree tree)\r\n   at Zbu.ModelsBuilder.Building.CodeParser.Parse(IDictionary`2 files, IEnumerable`1 referencedAssemblies)\r\n   at Zbu.ModelsBuilder.AspNet.ModelsBuilderApiController.GetModels(GetModelsData data)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.<GetExecutor>b__c(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n   at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)"}

    ZbuModelsBuilder:    at Zbu.ModelsBuilder.AspNet.ModelsBuilderApi.EnsureSuccess(HttpResponseMessage result)

       at Zbu.ModelsBuilder.AspNet.ModelsBuilderApi.GetModels(Dictionary`2 ourFiles, String modelsNamespace)

       at Zbu.ModelsBuilder.CustomTool.CustomTool.ZbuModelsBuilder.GenerateRaw(String wszInputFilePath, String wszDefaultNamespace, IntPtr[] rgbOutputFileContents, UInt32& pcbOutput, String& errMsg)

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Mar 17, 2015 @ 17:24
    Jeroen Breuer
    0

    I've also upgraded and the first time I also got an error. Not sure if it's the same error, but after rebooting my pc it did work.

    Jeroen

  • Marthijn Wassink 17 posts 50 karma points
    Mar 18, 2015 @ 11:29
    Marthijn Wassink
    0

    Got the same problem. Not able to upgrade

     

    ZbuModelsBuilder: ZbuModelsBuilder failed to generate code: Exception: Response status code does not indicate success (InternalServerError)

    {"Message":"An error has occurred.","ExceptionMessage":"Common Language Runtime detected an invalid program.","ExceptionType":"System.InvalidProgramException","StackTrace":"   at System.Collections.Immutable.SecurePooledObject`1.Use[TCaller](TCaller& caller)\r\n   at System.Collections.Immutable.SortedInt32KeyNode`1.Enumerator.PushLeft(SortedInt32KeyNode`1 node)\r\n   at System.Collections.Immutable.SortedInt32KeyNode`1.Enumerator..ctor(SortedInt32KeyNode`1 root)\r\n   at System.Collections.Immutable.ImmutableDictionary`2.Enumerator..ctor(SortedInt32KeyNode`1 root, Builder builder)\r\n   at System.Collections.Immutable.ImmutableDictionary`2.GetEnumerator()\r\n   at System.Collections.Immutable.ImmutableDictionary`2.System.Collections.Generic.ICollection>.CopyTo(KeyValuePair`2[] array, Int32 arrayIndex)\r\n   at 

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Mar 18, 2015 @ 12:05
    Jeroen Breuer
    0

    If you're still having errors you can report them here: https://github.com/zpqrtbnk/Zbu.ModelsBuilder/issues

    Jeroen

  • Richard Eyres 98 posts 580 karma points
    Mar 18, 2015 @ 12:21
    Richard Eyres
    0

    I tried a reboot, and the same error is appearing. I have taken Jeroens excellent suggestion and raised an issue. I will update once i have something to report back.

  • Stephen 767 posts 2273 karma points c-trib
    Mar 18, 2015 @ 18:29
    Stephen
    102

    As explained on the issue tracker https://github.com/zpqrtbnk/Zbu.ModelsBuilder/issues/44 this is due to a Roslyn bug which is due to an Immutable library bug which is due to a JIT bug in .NET pre-4.5.2, soooo.... when Roslyn 1.0-rc2 is released, I'll release a new version of the models builder that will work on .NET pre-4.5.2 but in the meantime, it looks like .NET 4.5.2 is required -- that is, if you encounter that issue, as not everybody seems to be affected.

  • Marthijn Wassink 17 posts 50 karma points
    Mar 18, 2015 @ 20:01
    Marthijn Wassink
    0

    After installing 4.5.2 it worked perfectly! Thanks Stephen.

  • Richard Eyres 98 posts 580 karma points
    Mar 19, 2015 @ 09:09
    Richard Eyres
    0

    Thanks to Stephen we have an answer. 4.5.2 is needed for ModelsBuilder to work with 2.1.1.

  • Mark Bennett 199 posts 375 karma points
    Apr 16, 2015 @ 14:15
    Mark Bennett
    0

    So I had this issue as well. Models builder was fine when using IIS express but wouldn't work when running the site under proper IIS. This is no doubt due to VS2013 running under 4.5.2 and the OS didn't have 4.5.2 on it.

    After eventually working out that my dev box didn't have enough space to install 4.5.2 on it (windows update was failing with a cryptic message). I allocated some more space and the update ran fine.

    Models builder now works a treat against IIS :)

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Jun 26, 2015 @ 12:18
    Alex Skrypnyk
    0

    Thanks, upgrading .net framework helps !

Please Sign in or register to post replies

Write your reply to:

Draft