dotnet / razor

Compiler and tooling experience for Razor ASP.NET Core apps in Visual Studio, Visual Studio for Mac, and VS Code.
https://asp.net
MIT License
502 stars 193 forks source link

Blazor wasm - compiles successful .net 6 #7075

Open dkboon01 opened 2 years ago

dkboon01 commented 2 years ago

Is there an existing issue for this?

Describe the bug

We have a blazor client wasm project that compiles fine in .net 6 and is being used in an azure appservice successful. We are trying to look forward and want to try .net 7 preview 7. However, first try on rebuilding and compiling. Getting error message on Dump.razor page. Looks like razor doesn't like something. I have tried both visual studio professional 2022 version 17.3.1 and visual studio version 17.4 preview 1.0 --> Both are giving me the same error Screenshot 2022-08-22 161646

Expected Behavior

Successful compile

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

7.0.100-preview.7.22377.5

Anything else?

Screenshot 2022-08-22 164059

TanayParikh commented 2 years ago

Hey, thanks for reaching out. Can you please try cleaning the project and deleting the bin and obj folders. Does the build subsequently succeed?

ghost commented 2 years ago

Hi @dkboon01. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

dkboon01 commented 2 years ago

I delete bin and obj folder still getting a build error. Should I send you the entire solution? It just weird that it works .net 6. I tried inserting a blank line just to see if inserting a blank would help.

Screenshot 2022-08-22 205222

TanayParikh commented 2 years ago

Should I send you the entire solution?

We can't investigate entire (complex) solutions, but feel free to provide a minimal public, github repo containing a minimal application which reproduces this issue.

dkboon01 commented 2 years ago

One more question both of these errors seem to be on an event callback where the parameter being passed is a tuple. We have the method defined like this "public async Task OnCardOrderEdit((DispatchOrderDetail orddtl, bool refresh) args)" is there anything about an event callback in .net 7 where the argument passed as tuple wont' work?

TanayParikh commented 2 years ago

I'm not currently aware of a known issue in that specific area, but it could be an issue. Does it work if you don't use a tuple?

dkboon01 commented 2 years ago

So yesterday i found this in the [documentation](What's new in C# 11 - C# Guide | Microsoft Docs) about using the ValueTuple syntax. I changed it but I'm still getting the same red line in the razor page using visual studio 2022 preview 1

dkboon01 commented 2 years ago

In an event in blazor wasm are we limited to passing in one parameter? That is why we are using a Tuple in the original code