You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
start the app, and wait until see Loading… in the browser
write /Test1 in the browser url and you'll see the RazorApp1/index.razor as expected
now, if you try to click the counter and fetchdata link, probably you'll go to the right page but, if you see the browser console by f12, you'll find the routing error like:
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:
Eilon
added
the
area-mvc
Includes: MVC, Actions and Controllers, Localization, CORS, most templates
label
Mar 28, 2019
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: