Since there is no code in the question, I will try to make a general answer as much as possible.
This exception occurs when you use this overload of PathString.FromUriComponent(string) , and the line does not start with the / character
so, for example, the following code will throw an exception:
PathString.FromUriComponent("controllerName/actionName"); // throw exception
and to fix the previous exception, you can write like this
PathString.FromUriComponent("/controllerName/actionName");
and of course it will be a relative path.
If you want to use an absolute path (rather than starting a line with / ), then you must use another overload of this method, which takes a Uri object as a parameter instead of string
here is an example
// use an absolute path PathString.FromUriComponent(new Uri("https://localhost:8000/controller/action/"))
source share