Invalid URI: The format of the URI could not be determined.- nopCommerce 4.10

1 year ago
Guys,

i have downloaded nopCommerce 4.10 Source Code and was able to run the application for the first time (configured admin user and database).

The next time when i try to run the nopCommerce 4.10 application it throws

'Invalid URI: The format of the URI could not be determined.'

This error is coming from ModifyQueryString method in nopCommerce_4.10_Source\Libraries\Nop.Core\WebHelper.cs.

        public virtual string ModifyQueryString(string url, string key, params string[] values)
        {
            if (string.IsNullOrEmpty(url))
                return string.Empty;

            if (string.IsNullOrEmpty(key))
                return url;

            //get current query parameters
            var uri = new Uri(url);
            var queryParameters = QueryHelpers.ParseQuery(uri.Query);

            //and add passed one
            queryParameters[key] = new StringValues(values);
            var queryBuilder = new QueryBuilder(queryParameters
                .ToDictionary(parameter => parameter.Key, parameter => parameter.Value.ToString()));

            //create new URL with passed query parameters
            url = $"{uri.GetLeftPart(UriPartial.Path)}{queryBuilder.ToQueryString()}{uri.Fragment}";

            return url;
        }

i have also underlined the code in the ModifyQueryString method where i am getting this error.

when ModifyQueryString method is called the url parameter of this method has '/changecurrency/1', key parameter of this method has 'returnurl=%2F' and the values parameter of this method has null.

i also checked this ModifyQueryString method in previous version (nopCommerce 4.0). their this method is having different implementation and parameters.

any suggestion for fixing this error would greatly helpful

Thanks.
1 year ago
I am also facing the same problem after upgrading. Any ideas?
1 year ago
Thanks. Here is a work item for it
1 year ago
Hi,

Has anyone found a work around for this please?
Trying to test a payment plugin in Visual studio but get this error on debugging?
Many thanks!!
1 year ago
this message is for nopcommerce development team:

the error message above appeared to me when i chananged from the default theme to the other theme come with nopcommerce.

the theme of the public store changed, no problem, but when i click login link an exception page appear with the message: invalid uri, the format of the uri could not be determined

Please consider this a bug and try to resolve it.

thanks
1 year ago
[email protected] wrote:

the error message above appeared to me when i changed from the default theme to the other theme come with nopcommerce.

the theme of the public store changed, no problem, but when i click login link an exception page appear with the message: invalid uri, the format of the uri could not be determined
thanks


What version of nopcommerce are you currently running and did you donwload the official release of that version or download it through a development version of the source code?

Also, can you please clarify that to recreate the issue you are saying that:

1. You downloaded an additional theme.
2. Changed the theme through administration.
3. Tried to log back in and experienced the exception.

Thanks
1 year ago
Also [email protected], if you can access your log in Admin -> System -> Log, has anything been logged regarding this issue?  If so please provide the Full Message.

Thanks
2 weeks ago
Hi, the error is in [Views\Shared\Components\OrderSummary\Default.cshtml] where

var editCartItemUrl = Url.RouteUrl("Product", new { SeName = item.ProductSeName });

should be replaced by :

var editCartItemUrl = Url.RouteUrl("Product", new { SeName = item.ProductSeName }, webHelper.CurrentRequestProtocol);