Blazor project with Blazor class library

Ingo Manthey 41 Ansehenspunkte
2024-08-08T21:03:21.6333333+00:00

I created a second Blazor class library for my Blazor project InteractiveServer.
For example, I have my MainLayout in this dll and everything is displayed correctly.
If I create a page @page "/user/test" in this dll and then call it, I get the error 404

In the router I have the following code:

<Router AppAssembly="typeof(Program).Assembly"

AdditionalAssemblies="new[] { typeof(MainLayout).Assembly }">

<Found Context="routeData">

MainLayout is located in the 2nd dll.
<Project Sdk="Microsoft.NET.Sdk.Razor">

Can someone help me here?

.NET
.NET
Microsoft-Technologien, die auf dem .NET-Softwareframework basieren.
33 Fragen
Blazor
Blazor
Ein kostenloses Open-Source-Webframework, mit dem Entwickler Web-Apps mit C# und HTML erstellen können, die von Microsoft entwickelt werden.
9 Fragen
0 Kommentare Keine Kommentare
{count} Stimmen

Akzeptierte Antwort
  1. Thomas Wycichowski TWyTec 1,040 Ansehenspunkte
    2024-08-10T15:18:59.76+00:00

    Hi,

    Du hast im deutschsprachigem Forum deine Frage gestellt, deswegen schreib bitte auch deutsch.

    Hast Du in der _Imports den Namespace zur MainLayout hinterlegt? Der Namespace muss auf den Ordner verweisen in der die MainLayout ist

    VG

    Thomas

    0 Kommentare Keine Kommentare

0 zusätzliche Antworten

Sortieren nach: Sehr hilfreich

Ihre Antwort

Antworten können vom Autor der Frage als akzeptierte Antworten gekennzeichnet werden, was Benutzern hilft, die Antwort zu erkennen, die das Problem des Autors gelöst hat.