New versions break Default BaseUri (CSharp)
See original GitHub issueSimilar 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:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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
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!