Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Route from different assembly/dll/project #8883

Closed
niconico49 opened this issue Mar 28, 2019 · 1 comment
Closed

Route from different assembly/dll/project #8883

niconico49 opened this issue Mar 28, 2019 · 1 comment
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Duplicate Resolved as a duplicate of another issue

Comments

@niconico49
Copy link

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:

  1. start the app, and wait until see Loading… in the browser
  2. write /Test1 in the browser url and you'll see the RazorApp1/index.razor as expected
  3. 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?

@Eilon Eilon added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Mar 28, 2019
@pranavkm pranavkm added the area-blazor Includes: Blazor, Razor Components label Mar 28, 2019
@mkArtakMSFT
Copy link
Member

Thanks for contacting us, @niconico49.
We're tracking a separate issue which would solve this problem at #5465.

@mkArtakMSFT mkArtakMSFT added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Mar 29, 2019
@mkArtakMSFT mkArtakMSFT removed area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates labels May 9, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Duplicate Resolved as a duplicate of another issue
Projects
None yet
Development

No branches or pull requests

4 participants