Invalid URI: The Uri string is too long. - NET MAUI
See original GitHub issueDescription
This exception occurs after running the app for several hours, I am trying to navigate to another page using the code below
var navigationParameter = new Dictionary<string, object> { { "PickCategories", info } }; await Shell.Current.GoToAsync(nameof(InformationView), true, navigationParameter);
I am passing the same data all the time in a loop, it works for hours then starts throwing the exception “Invalid URI: The Uri string is too long.” Why does it not complain at first and then start complaining about the same input?
Steps to Reproduce
1-Create a NET MAUI app with shell navigation as
var navigationParameter = new Dictionary<string, object>
{
{ "PickCategories", info }
};
await Shell.Current.GoToAsync(nameof(InformationView), true, navigationParameter);
and send an object as a parameter and receive that object via ApplyQueryAttributes and bind the object sent to BindingContext
void IQueryAttributable.ApplyQueryAttributes(IDictionary<string, object> message)
{
var infoMessage = message["ImageMedia"] as Media;
BindingContext = infoMessage;
//The above line throws an exception
Link to public reproduction project repository
https://github.com/mgungorchamp/InfoBoard/tree/IndividualViewPage
Version with bug
7.0.49
Last version that worked well
6.0
Affected platforms
Android, Windows
Affected platform versions
.NET MAUI Windows and Android App
Did you find any workaround?
Nope
Relevant log output
No response
Issue Analytics
- State:
- Created 2 months ago
- Comments:7 (2 by maintainers)
@mgungorchamp I am not quite sure if this is how it works, but I would suspect you are keep adding to your navigation stack until it is too long? how do you navigate back to your pages? if you are not using GoToAsync(“…”) when you leave a page and instead use GoToAsync(nameof(YourPage)), you could end up in an indefinite loop. I think using absolute uri strings when you are going back to your Root pages could also help to clear the stack.
@mgungorchamp Please open a separate issue for this new problem.