Skip to content

Conversation

@hakenr
Copy link
Member

@hakenr hakenr commented Nov 29, 2024

The Microsoft.AspNetCore.Components.Forms package is already transitively referenced by Microsoft.AspNetCore.Components.Web package (which is included in the RCL template). No need to add explicit reference to Forms package.


Internal previews

📄 File 🔗 Preview link
aspnetcore/blazor/webassembly-lazy-load-assemblies.md Lazy load assemblies in ASP.NET Core Blazor WebAssembly

@hakenr hakenr requested a review from guardrex as a code owner November 29, 2024 00:24
@guardrex guardrex self-assigned this Nov 29, 2024
Copy link
Collaborator

@guardrex guardrex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See if my suggestion makes sense. I agree that the text is wrong, but a replacement could meet the original goal of making it clear what packages are important here.

* Visual Studio: Right-click the solution file in **Solution Explorer** and select **Add** > **New project**. From the dialog of new project types, select **Razor Class Library**. Name the project `GrantImaharaRobotControls`. Do **not** select the **Support pages and view** checkbox.
* Visual Studio Code/.NET CLI: Execute `dotnet new razorclasslib -o GrantImaharaRobotControls` from a command prompt. The `-o|--output` option creates a folder and names the project `GrantImaharaRobotControls`.

The example component presented later in this section uses a [Blazor form](xref:blazor/forms/index). In the RCL project, add the [`Microsoft.AspNetCore.Components.Forms`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.Forms) package to the project.
Copy link
Collaborator

@guardrex guardrex Dec 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to state what's going on with the packages here. This could say something like ...

The example component presented later in this section uses a [Blazor form](xref:blazor/forms/index). Because the RCL was created without supporting pages and views, the RCL includes a package reference for [`Microsoft.AspNetCore.Components.Web`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.Web), which transitivity includes the [`Microsoft.AspNetCore.Components.Forms`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.Forms) package.

[!INCLUDE[](~/includes/package-reference.md)]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you create the RCL with "Support pages and view" checked, the new project still successfully compiles the Robot.razor component (with <EditForm> and <InputRadioGroup>), most likely because of <FrameworkReference Include="Microsoft.AspNetCore.App" />.

Why do you think we need to include package-related info in the article?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Truly, it was just a passing concern. I didn't know what would happen in that configuration. Let's go ahead with your suggestion.

Copy link
Collaborator

@guardrex guardrex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! 🎉

@guardrex guardrex merged commit 2cd28f1 into dotnet:main Dec 1, 2024
3 checks passed
@hakenr hakenr deleted the patch-43 branch December 1, 2024 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants