eggsaVEVO
❔ Two Program.cs files in new Blazor Web App template.
After playing around with the preview version of .NET 8 I noticed that in the new Blazor Web App template (which combines webassembly and server side rendering) there are two Program.cs files. I get that for each environment an individual entry point is needed. But its somewhat magic to me how Blazor knows which main function to call. Does the assembly generated by the client project have some special attributes that allows the Blazor app to know that this is the dll for the webassembly rendering or how exactly does this work?
13 replies
❔ You cannot use a covariant type parameter as a generic type constraint for interface methods.
I do understand what variant type parameters are after reading about covariance and contravariance. What I do not understand however is what the sentence "You cannot use a covariant type parameter as a generic type constraint for interface methods." or "You can use a contravariant type parameter as a generic type constraint for an interface method." means from https://learn.microsoft.com/en-us/dotnet/standard/generics/covariance-and-contravariance#define-variant-generic-interfaces-and-delegates. Can someone explain to me the meaning of this sentence is?
16 replies