Create, Reference and use a Razor class library.

Rafaeleliasgri 20 Reputation points
2024-04-24T15:49:23.6733333+00:00

Hello!
I'm training on Microsoft Learn. My current stage is the following module:

https://learn.microsoft.com/en-us/training/modules/blazor-build-reusable-components/3-create-razor-class-library

User's image

First of all, this exercise starts saying that it uses the .NET 6.0 SDK. However, the instructions given on it are all for .NET 8.0 SDK.

I strictly followed the instructions for four times, initially using .NET 8.0 SDK, then tried with .NET 6.0 SDK (it wasn't possible to create a new blazor app with the option -f net6.0) and all times got the same problem showed below:

User's image

I've successfully made the reference to FirstClassLibrary as instructed.

It seems that there's some problem on this exercise's instructions. Maybe lacking some step.
I appreciate in advance any help given.
Thank you!

Rafael Elias.

This question is related to the following Learning Module

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,398 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,396 questions
Blazor Training
Blazor Training
Blazor: A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.Training: Instruction to develop new skills.
1 question
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 56,846 Reputation points
    2024-04-24T16:22:57.96+00:00

    you seem to have missed the step:

    dotnet add reference ../FirstClassLibrary

    in the blazer project folder, or the folders are not siblings.

    note: I did the tutorial on my Mac with net 8, took a couple minutes and ran the first time.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful