Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scaffolding in Blazor is unaware of (implicit inheritance?) #2757

Open
eberleitguy opened this issue May 18, 2024 · 0 comments
Open

Scaffolding in Blazor is unaware of (implicit inheritance?) #2757

eberleitguy opened this issue May 18, 2024 · 0 comments

Comments

@eberleitguy
Copy link

eberleitguy commented May 18, 2024

I'm not amazing at searching, but i didn't find anything similar to my eyes. Apologies in advance if i overlooked.

This bug is pretty simple.
When using the Quick Action "Extract block to code-behind", the resulting code-behind doesn't have explicitly defined inheritance, and appears, in the file, to be a bare class. Of course, blazor is all fancy and happily runs, for the most part, despite this. (not clear why, i did get into a couple of states where roslyn was underlining these "incorrect" methods, but a restart of VS returned functionality).

image

image

Find a screen-to-gif of the issue in action below.

For the most part i was following Dan Roth's Blazor front end youtube series (Starting here: https://www.youtube.com/watch?v=sIIfnGqEIds) , but early on took the path of extracting the "Counter" c# code to a codebehind file. I ran into the issue much later when i was following along with the scaffolding in video 9.
ScaffoldingProblem

Find entire sample project attached.

There are branches tagging the specific problems.
TrainingSample.zip

#Environment:
Microsoft Visual Studio Community 2022
Version 17.9.7
VisualStudio.17.Release/17.9.7+34902.65
Microsoft .NET Framework
Version 4.8.09032

Installed Version: Community

ASP.NET and Web Tools 17.9.199.22661
ASP.NET and Web Tools

Azure App Service Tools v3.0.0 17.9.199.22661
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 17.9.199.22661
Azure Functions and Web Jobs Tools

C# Tools 4.9.0-3.24121.1+a98c90d56455379836dd5c845b35fa932b00cfa3
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

NuGet Package Manager 6.9.2
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Razor (ASP.NET Core) 17.9.2.2412004+684740676513b3b208d5bd5b7f8786dab8d287b7
Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools 17.9.56.1
Microsoft SQL Server Data Tools

TypeScript Tools 17.0.30103.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 4.9.0-3.24121.1+a98c90d56455379836dd5c845b35fa932b00cfa3
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 17.9.0-beta.23614.3+a521e1cd420beb56c15faf6836184fadd2b7937a
Microsoft Visual F# Tools

Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.

OS Info:
WIndows 11 Home 22H2 Build 22521.2283

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant