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)
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
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.
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.
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.
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)
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
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
If you're still having errors you can report them here: https://github.com/zpqrtbnk/Zbu.ModelsBuilder/issues
Jeroen
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.
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.
After installing 4.5.2 it worked perfectly! Thanks Stephen.
Thanks to Stephen we have an answer. 4.5.2 is needed for ModelsBuilder to work with 2.1.1.
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 :)
Thanks, upgrading .net framework helps !
is working on a reply...