chanan / BlazorStyled

CSS in Blazor Components
https://blazorstyled.io
The Unlicense
191 stars 19 forks source link

Support for .NET5-rc1 Fields on RenderTreeFrame breaking change #110

Closed qin-guan closed 3 years ago

qin-guan commented 4 years ago

When running BlazorStyled in .NET5-rc1, I experience the following issue:

warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
      Unhandled exception rendering component: Field not found: 'Microsoft.AspNetCore.Components.RenderTree.RenderTreeFrame.FrameType'.
      System.MissingFieldException: Field not found: 'Microsoft.AspNetCore.Components.RenderTree.RenderTreeFrame.FrameType'.
         at BlazorStyled.Internal.RenderFragmentExtensions.RenderAsSimpleString(RenderFragment childContent)
         at BlazorStyled.Styled.ProcessParameters()
         at BlazorStyled.Styled.OnAfterRenderAsync(Boolean firstRender)
fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
      Unhandled exception in circuit 'OMUpj4LKP-YliJQf-xXpCFPQKKLft3UpHJniZf7FHww'.
      System.AggregateException: One or more errors occurred. (Field not found: 'Microsoft.AspNetCore.Components.RenderTree.RenderTreeFrame.FrameType'.)
       ---> System.MissingFieldException: Field not found: 'Microsoft.AspNetCore.Components.RenderTree.RenderTreeFrame.FrameType'.
         at BlazorStyled.Internal.RenderFragmentExtensions.RenderAsSimpleString(RenderFragment childContent)
         at BlazorStyled.Styled.ProcessParameters()
         at BlazorStyled.Styled.OnAfterRenderAsync(Boolean firstRender)
         --- End of inner exception stack trace ---

A search brought me here, where it was written:

Old behavior

Public members on RenderTreeFrame were defined as fields, for example renderTreeFrame.Sequence and renderTreeFrame.ElementName.

New behavior

Public members on RenderTreeFrame are defined as properties with the same names as before, for example renderTreeFrame.Sequence and renderTreeFrame.ElementName.

If older precompiled code has not been recompiled since this change, it may throw an exception similar to MissingFieldException: Field not found: 'Microsoft.AspNetCore.Components.RenderTree.RenderTreeFrame.FrameType'.

chanan commented 4 years ago

Thanks for the report, we did not convert the project yet to .net5, so it's not a surprise that things are breaking in .net5. We will address this when we convert over to .net5.

qin-guan commented 4 years ago

@chanan thanks for the quick reply, do you have a rough timeline on when that would be?

chanan commented 4 years ago

I wasn't planning on it till it gets released, but if people are using this library and are stuck due to this, I will try to do it sooner. Of course, if you feel up to it, feel free to send a PR, which will increase the speed this gets done at

chanan commented 4 years ago

@qin-guan I created a branch for .net 5: https://github.com/chanan/BlazorStyled/tree/net5rc1 I was not able to run web assembly - some missing file error, but I was able to run server side without a problem. I am not currently sure what the error you are seeing is. But once I figure out why cleint side isnt working, I will create a build as 4.0.0-alpha-01

qin-guan commented 4 years ago

@chanan thanks! do you think u could copy the error here? i've been having some issue running blazor wasm as well.

chanan commented 4 years ago

I am missing some setting somewhere, just not sure where. I am not getting a compile error, it just wont run.

If I "run" I get a blank browser with the address not filled in. If I "run without debugging" - I get an error in the browser that it can't find _framework/blazor.webassembly.js

Checking the bin folder it doesnt have the wwwroot folder in it. Comparing it to a blank .net blazer wasm project, I haven't yet located what I am missing.

qin-guan commented 3 years ago

@chanan have you been able to get .NET5 working, since it has been just released?

chanan commented 3 years ago

I plan to work on this weekend. Hopefully shouldn't have major issues

chanan commented 3 years ago

I have .net 5 working, I checked both server side and client side sample doc site and everything seems to work. I will release it in a few hours, please check your defect at that time and see if it still occurs.

chanan commented 3 years ago

I just pushed: BlazorStyled.3.1.0-rc1 compiled in net5.0

qin-guan commented 3 years ago

i can verify that 3.1.0-rc1 works with .net5, thanks :)

chanan commented 3 years ago

Released 3.1