Route from different assembly/dll/project #8883
Labels
area-blazor
Includes: Blazor, Razor Components
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
Describe the bug
How to add ruoting from different assembly loaded dynamically in the solution?
To Reproduce
Create 3 project core 3 preview 3
a) one project (WebApp for instance)
b) and two projects (RazorApp1 and RazorApp2 for instance)
add string "Test1" and "Test2" in every razor pages with @page attribute in every project to avoid routing conflicts:
for example index in razorApp1 evolve from @page "/" to @page "/Test1"
and index in razorApp1 evolve from @page "/" to @page "/Test2"
do the same for other razor pages (like counter and fetchData)
Expected behaviour
now, if you try to reference these projects or, like the topic of this issue, add dynamically these project by some external tool as ExtCore, you will find strange Routing behaviour.
For example:
Uncaught (in promise) Error: System.InvalidOperationException: 'Router' cannot find any component with a route for '/counter', and no fallback is defined.
at Microsoft.JSInterop.DotNetDispatcher.InvokeSynchronously(:44358/String assemblyName, String methodIdentifier, Object targetInstance, String argsJson)
at Microsoft.JSInterop.DotNetDispatcher.BeginInvoke(:44358/String callId, String assemblyName, String methodIdentifier, Int64 dotNetObjectId, String argsJson)
at endInvokeDotNetFromJS (components.server.js:23)
at components.server.js:23
at new Promise ()
at e.beginInvokeJSFromDotNet (components.server.js:23)
at components.server.js:16
at Array.forEach ()
at e.invokeClientMethod (components.server.js:16)
at e.processIncomingData (components.server.js:16)
at e.connection.onreceive (components.server.js:16)
at WebSocket.i.onmessage (components.server.js:16)
endInvokeDotNetFromJS @ components.server.js:23
(anonymous) @ components.server.js:23
beginInvokeJSFromDotNet @ components.server.js:23
(anonymous) @ components.server.js:16
e.invokeClientMethod @ components.server.js:16
e.processIncomingData @ components.server.js:16
connection.onreceive @ components.server.js:16
i.onmessage @ components.server.js:16
Promise.then (async)
u @ components.server.js:16
(anonymous) @ components.server.js:16
r @ components.server.js:16
l @ components.server.js:16
c @ components.server.js:16
(anonymous) @ components.server.js:16
So, the question is:
How can I load a project dynamically in the solution with the routing too?
The text was updated successfully, but these errors were encountered: