aspnetcore: Blazor - rzc generate exited with code 1. DotNet Core 3.0.100-preview8-013656
If you believe you have an issue that affects the security of the platform please do NOT create an issue and instead email your issue details to secure@microsoft.com. Your report may be eligible for our bug bounty but ONLY if it is reported through email.
Describe the bug
Unable to build Blazor Server-side project after installing preview 8
To Reproduce
Steps to reproduce the behavior:
- Using this version of ASP.NET Core ‘3.0.100-preview8-013656’
- Run this code ‘dotnet build’
- With these arguments ‘…’
- See error
Specified argument was out of the range of valid values. (Parameter 'index') at Microsoft.AspNetCore.Razor.Language.Intermediate.IntermediateNodeCollection.get_Item(Int32 index) at Microsoft.AspNetCore.Razor.Language.Components.ComponentReferenceCaptureLoweringPass.ExecuteCore(RazorCodeDocument codeDocument, DocumentIntermediateNode documentNode) at Microsoft.AspNetCore.Razor.Language.IntermediateNodePassBase.Execute(RazorCodeDocument codeDocument, DocumentIntermediateNode documentNode) at Microsoft.AspNetCore.Razor.Language.DefaultRazorOptimizationPhase.ExecuteCore(RazorCodeDocument codeDocument) at Microsoft.AspNetCore.Razor.Language.RazorEnginePhaseBase.Execute(RazorCodeDocument codeDocument) at Microsoft.AspNetCore.Razor.Language.DefaultRazorEngine.Process(RazorCodeDocument document) at Microsoft.AspNetCore.Razor.Language.DefaultRazorProjectEngine.ProcessCore(RazorCodeDocument codeDocument) at Microsoft.AspNetCore.Razor.Language.RazorProjectEngine.Process(RazorProjectItem projectItem) at Microsoft.AspNetCore.Razor.Tools.GenerateCommand.<>c__DisplayClass46_0.<GenerateCode>b__0(Int32 i) at System.Threading.Tasks.Parallel.<>c__DisplayClass19_01.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception source) at System.Threading.Tasks.Parallel.<>c__DisplayClass19_01.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) at System.Threading.Tasks.TaskReplicator.Replica1.ExecuteAction(Boolean& yieldedBeforeCompletion) at System.Threading.Tasks.TaskReplicator.Replica.Execute() C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.CodeGeneration.targets(150,5): error : rzc generate exited with code 1. `
Expected behavior
Expected to see the successful build
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Include the output of dotnet --info
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 4
- Comments: 23 (8 by maintainers)
I had this problem, it was solved (in my case) by adding @ref:suppressField My component inherits a base class, and I was doing something like this:
@if (!IsWaiting) { <Something @ref="field"/> } else { <Something @ref="field"/> }I added @ref:suppressField, and it worked.
What was painful about it was determining where the problem (in which file) it was occuring. There was no reference to the .razor file that was causing the problem. Had to remove everything and put each file back one by one.
@hitchhiker I think you’re right. We modified our usages of @ref fields and added
@ref:suppressFieldNow the project is compiling and working again.@dazinator that should be already fixed in Preview9: https://github.com/aspnet/AspNetCore/issues/12661