question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New versions break Default BaseUri (CSharp)

See original GitHub issue

Similar to the issue 2746 (https://github.com/Azure/autorest/issues/2746)

Autorest version: 2.0.4245

As in the original bug, the root class has a method: private void Initialize() Where the last versions of autorest set BaseUri within the relative path: BaseUri = new System.Uri("/SomeService.Api.Services/SomeService"); Previously it was: BaseUri = new System.Uri("http://localhost/SomeService.Api.Services/SomeService");

System.Uri constructor expect the absolute path and as a result throw next error: System.UriFormatException: 'Invalid URI: The format of the URI could not be determined.'

PS: I’m calling the clients constructor providing baseUri, but it still call Initialize using the default one.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
giperFoxcommented, Mar 10, 2018

@olydis please find swagger file attached. Together with swagger.json in the package you can find two auto-generated C# clients (version 2.0.4245, and 2.0.4147). The cause of the issue is similar to the #2746, but not the same, so probably the previous fix does not cover this particular case. SwaggerAutoRest.zip

0reactions
av-millercommented, May 3, 2019

This is not fixed still. Host needs to be configurable in consumer. Hard coding host into client package is non-sense. I wish I never had to use this package. Microsoft has not changed since 2000s, issues are getting closed when they are not fixed!

Read more comments on GitHub >

github_iconTop Results From Across the Web

BaseUri in Saxon causing problems when trying to compile ...
1 Answer 1 ... You have a few issues: processor.NewXsltCompiler() returns a new XsltCompiler each time it is called. You call it twice:...
Read more >
RestSharp Next (v107)
The latest version of RestSharp is v107. It's a major upgrade, which contains quite a few breaking changes. The most important change is...
Read more >
ASP.NET Core Blazor WebAssembly additional security ...
For a hosted Blazor solution based on the Blazor WebAssembly project template, request URIs are within the app's base URI by default.
Read more >
Routing | Documentation - ServiceStack Docs
NET 6+ JsonApiClient that's pre-configured to use /api fallback by default: var client = new JsonApiClient(baseUri);. All .NET Clients use any matching ...
Read more >
EncryptedXml.cs source code in C# .NET
XmlEncAES192Url: case EncryptedXml.XmlEncAES256Url: initBytesSize = 16; break; default: // The Uri is not supported. throw new CryptographicException( ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found