Coder Social home page Coder Social logo

generateaspnetcoreclient's Introduction

generateaspnetcoreclient's People

Contributors

dreamescaper avatar pmccowat avatar rysbilinski avatar vmachacek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

generateaspnetcoreclient's Issues

.NET 6 support

I think it stopped working on .net 6

C:\Dev\Dev\SuperCat\src\SuperCat\Controllers\UsersController.cs(303,37): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [C:\Dev\Dev\SuperCat\src\SuperCat\SuperCat.csproj]
Failed to find framework directory: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.Text.Json.JsonElement.GetProperty(String propertyName)
   at GenerateAspNetCoreClient.CustomLoadContext.GetFrameworkPath(String assemblyPath) in C:\Users\ollia\Source\Repos\GenerateAspNetCoreClient\GenerateAspNetCoreClient\CustomLoadContext.cs:line 87
Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at System.Reflection.RuntimeAssembly.InternalLoad(ObjectHandleOnStack assemblyName, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, Boolean throwOnFileNotFound, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack retAssembly)
   at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, RuntimeAssembly requestingAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, AssemblyLoadContext assemblyLoadContext)
   at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyName(AssemblyName assemblyName)
   at GenerateAspNetCoreClient.CustomLoadContext.Load(AssemblyName assemblyName, Boolean fallbackToDefault) in C:\Users\ollia\Source\Repos\GenerateAspNetCoreClient\GenerateAspNetCoreClient\CustomLoadContext.cs:line 31
   at GenerateAspNetCoreClient.CustomLoadContext.Load(AssemblyName assemblyName) in C:\Users\ollia\Source\Repos\GenerateAspNetCoreClient\GenerateAspNetCoreClient\CustomLoadContext.cs:line 60
   at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingLoad(AssemblyName assemblyName)
   at System.Runtime.Loader.AssemblyLoadContext.Resolve(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName)
   at System.Reflection.RuntimeAssembly.get_EntryPoint()
   at GenerateAspNetCoreClient.Command.GenerateClientCommand.GetApiExplorer(Assembly assembly, String environment) in C:\Users\ollia\Source\Repos\GenerateAspNetCoreClient\GenerateAspNetCoreClient.Command\GenerateClientCommand.cs:line 42
   at GenerateAspNetCoreClient.Command.GenerateClientCommand.Invoke(Assembly assembly, GenerateClientOptions options) in C:\Users\ollia\Source\Repos\GenerateAspNetCoreClient\GenerateAspNetCoreClient.Command\GenerateClientCommand.cs:line 21
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at GenerateAspNetCoreClient.Program.CreateClient(GenerateClientOptions options) in C:\Users\ollia\Source\Repos\GenerateAspNetCoreClient\GenerateAspNetCoreClient\Program.cs:line 34
   at GenerateAspNetCoreClient.Program.<>c.<Main>b__0_0(GenerateClientOptions options) in C:\Users\ollia\Source\Repos\GenerateAspNetCoreClient\GenerateAspNetCoreClient\Program.cs:line 18
   at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
   at GenerateAspNetCoreClient.Program.Main(String[] args) in C:\Users\ollia\Source\Repos\GenerateAspNetCoreClient\GenerateAspNetCoreClient\Program.cs:line 16

Could not load type 'System.Runtime.CompilerServices.Unsafe' when running tool

Hello,

I am trying to run this tool against a simple dotnet 6 project, but something goes wrong during the execution.
The build step runs fine, but the execution right after that stops immediately. I have both dotnet 6 and dotnet 7 installed.
`
Build succeeded.
0 Warning(s)
0 Error(s)

Time Elapsed 00:00:08.50
fail: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[48]
An error occurred while reading the key ring.
System.TypeLoadException: Could not load type 'System.Runtime.CompilerServices.Unsafe' from assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlReader.MoveToContent()
at System.Xml.Linq.XElement.Load(XmlReader reader, LoadOptions options)
at System.Xml.Linq.XElement.Load(Stream stream, LoadOptions options)
at System.Xml.Linq.XElement.Load(Stream stream)
at Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository.ReadElementFromFile(String fullPath)
at Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository.GetAllElementsCore()+MoveNext()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository.GetAllElements() at Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager.GetAllKeys() at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider.CreateCacheableKeyRingCore(DateTimeOffset now, IKey keyJustAdded) at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider.Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.ICacheableKeyRingProvider.GetCacheableKeyRing(DateTimeOffset now) at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider.GetCurrentKeyRingCore(DateTime utcNow, Boolean forceRefresh) crit: Microsoft.AspNetCore.Hosting.Diagnostics[6] Application startup exception System.TypeLoadException: Could not load type 'System.Runtime.CompilerServices.Unsafe' from assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl) at System.Xml.XmlTextReaderImpl.Read() at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) at System.Xml.Linq.XDocument.Load(Stream stream, LoadOptions options) at System.Xml.Linq.XDocument.Load(Stream stream) at Microsoft.Extensions.FileProviders.Embedded.Manifest.ManifestParser.Parse(Assembly assembly, String name) at Microsoft.Extensions.FileProviders.Embedded.Manifest.ManifestParser.Parse(Assembly assembly) at Microsoft.Extensions.FileProviders.ManifestEmbeddedFileProvider..ctor(Assembly assembly) at Microsoft.AspNetCore.Components.Server.ConfigureStaticFilesOptions.PostConfigure(String name, StaticFileOptions options) at Microsoft.Extensions.Options.OptionsFactory1.Create(String name)
at Microsoft.Extensions.Options.UnnamedOptionsManager1.get_Value() at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware..ctor(RequestDelegate next, IWebHostEnvironment hostingEnv, IOptions1 options, ILoggerFactory loggerFactory)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.ConstructorInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.Extensions.Internal.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
at Microsoft.Extensions.Internal.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass5_0.b__0(RequestDelegate next)
at Microsoft.AspNetCore.Builder.ApplicationBuilder.Build()
at Microsoft.AspNetCore.Builder.WebApplication.BuildRequestDelegate()
at Microsoft.AspNetCore.Builder.WebApplicationBuilder.b__27_0(RequestDelegate next)
at Microsoft.AspNetCore.Builder.ApplicationBuilder.Build()
at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.AggregateException: One or more errors occurred. (Could not load type 'System.Runtime.CompilerServices.Unsafe' from assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.)
---> System.TypeLoadException: Could not load type 'System.Runtime.CompilerServices.Unsafe' from assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
at System.Xml.Linq.XDocument.Load(Stream stream, LoadOptions options)
at System.Xml.Linq.XDocument.Load(Stream stream)
at Microsoft.Extensions.FileProviders.Embedded.Manifest.ManifestParser.Parse(Assembly assembly, String name)
at Microsoft.Extensions.FileProviders.Embedded.Manifest.ManifestParser.Parse(Assembly assembly)
at Microsoft.Extensions.FileProviders.ManifestEmbeddedFileProvider..ctor(Assembly assembly)
at Microsoft.AspNetCore.Components.Server.ConfigureStaticFilesOptions.PostConfigure(String name, StaticFileOptions options)
at Microsoft.Extensions.Options.OptionsFactory1.Create(String name) at Microsoft.Extensions.Options.UnnamedOptionsManager1.get_Value()
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware..ctor(RequestDelegate next, IWebHostEnvironment hostingEnv, IOptions1 options, ILoggerFactory loggerFactory) at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) at System.Reflection.ConstructorInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.Extensions.Internal.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider) at Microsoft.Extensions.Internal.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass5_0.<UseMiddleware>b__0(RequestDelegate next) at Microsoft.AspNetCore.Builder.ApplicationBuilder.Build() at Microsoft.AspNetCore.Builder.WebApplication.BuildRequestDelegate() at Microsoft.AspNetCore.Builder.WebApplicationBuilder.<ConfigureApplication>b__27_0(RequestDelegate next) at Microsoft.AspNetCore.Builder.ApplicationBuilder.Build() at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken) at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host) at Microsoft.AspNetCore.Builder.WebApplication.Run(String url) at Program.<Main>$(String[] args) in C:\Users\kdecuyper\source\repos\WebDisplay\WebDisplayApp\Program.cs:line 38 at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait() at GenerateAspNetCoreClient.Command.ServiceProviderResolver.GetServiceProviderWithHostFactoryResolver(Assembly assembly) in /home/runner/work/GenerateAspNetCoreClient/GenerateAspNetCoreClient/GenerateAspNetCoreClient.Command/ServiceProviderResolver.cs:line 160 at GenerateAspNetCoreClient.Command.ServiceProviderResolver.GetServiceProvider(Assembly assembly) in /home/runner/work/GenerateAspNetCoreClient/GenerateAspNetCoreClient/GenerateAspNetCoreClient.Command/ServiceProviderResolver.cs:line 72 at GenerateAspNetCoreClient.Command.GenerateClientCommand.GetApiExplorer(Assembly assembly, String environment) in /home/runner/work/GenerateAspNetCoreClient/GenerateAspNetCoreClient/GenerateAspNetCoreClient.Command/GenerateClientCommand.cs:line 40 at GenerateAspNetCoreClient.Command.GenerateClientCommand.Invoke(Assembly assembly, GenerateClientOptions options) in /home/runner/work/GenerateAspNetCoreClient/GenerateAspNetCoreClient/GenerateAspNetCoreClient.Command/GenerateClientCommand.cs:line 19 at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) --- End of inner exception stack trace --- at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at GenerateAspNetCoreClient.Program.CreateClient(GenerateClientOptions options) in /home/runner/work/GenerateAspNetCoreClient/GenerateAspNetCoreClient/GenerateAspNetCoreClient/Program.cs:line 34 at GenerateAspNetCoreClient.Program.<>c.<Main>b__0_0(GenerateClientOptions options) in /home/runner/work/GenerateAspNetCoreClient/GenerateAspNetCoreClient/GenerateAspNetCoreClient/Program.cs:line 18 at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult1 result, Action1 action) at GenerateAspNetCoreClient.Program.Main(String[] args) in /home/runner/work/GenerateAspNetCoreClient/GenerateAspNetCoreClient/GenerateAspNetCoreClient/Program.cs:line 16

How can I solve this ? Is it an issue on my side ?

Generator dont check for query names for array type

I found very similar issue to this one #4
Lets say i have this. (Dont need to be enum, but any array type)

GetThing(string language, [FromQuery(Name = "language_types")] SomeEnum[]? languageTypes)

It generates

GetThing(string language, [Query] SomeEnum[] languageTypes = null);

It should be

GetThing(string language, [AliasAs("language_types")]  SomeEnum[] languageTypes = null);

Incorrect handling of [FromForm] parameter

After the line probably missing continue keyword.

Considering following code:

[ApiController]
[Route("[controller]/[action]")]
public class TestController
{
    [HttpPost]
    [Consumes("multipart/form-data")]
    public void Post([FromForm] TestModel testModel)
    {
    }
}

public class TestModel
{
    public IFormFile File { get; set; }
    
    public string String { get; set; }
}

Utility generates:

[Multipart]
[Post("/Test/Post")]
Task Post(MultipartItem testModel, [Body(BodySerializationMethod.UrlEncoded)] TestModel testModel = null);

This code will not work, because it contains duplicate parameter, and if rename it then Refit library would throw System.ArgumentException: Multipart requests may not contain a Body parameter.

If split parameters from model, the code will work correctly:

[Multipart]
[Post("/Test/Post")]
Task Post(MultipartItem file, string @string);

If Im understanding correctly, [FromForm] model should be splitted in separate parameters, if it contains IFormFile parameter.

How to avoid running the application?

This could be a cli flag or a package that you reference and based on that the target app may only build the service provider and stop before running the app.

2.0.0 enum converts to string

Controller

[Route("test")]
[ApiController]
[Authorize]
public class TestController : ControllerBase
{
    [HttpGet]
    [ProducesResponseType(typeof(ProductListResponse), (int)HttpStatusCode.OK)]
    public async Task<ProductListResponse> Products([FromQuery(Name = "sort_type")] ProductSortType? sortType)
    {
        return new ProductListResponse();
    }
}

Result where ProductSortType enum becomes string

 public partial interface ITestApi
 {
     [Get("/test")]
     Task<ProductListResponse> Products([AliasAs("sort_type")] string sorttype = null);
 }

It should be something related to .net8

Add "base path" to the GenerateClientOptions

Would it be possible to add command line switch to supply base path string so that every url generated by the tool starts with this base path?

I can take a look and produce a PR..

Partial interface

I realized when I need to "overwrite" generated functionality mostly to provide different return type for convenience, it would be nice to make interface partial where the generated file would stay the same and I can add custom endpoint in other file keeping them separated and compatible with auto re-generation.

Parameter generation error when model contains IFormFile

The generated method contains an extra Multipartitem param when you add an IFormFile property as the 1st property.
to replicate:
namespace TestWebApi.Models { public class SomeQueryModel { public IFormFile File { get; set; } //must be the first prop public string Param1 { get; set; } public Guid? Param2 { get; set; } public int Param3 { get; set; } } }

then the code generated will be something like:
[Multipart] [Post("/WeatherForecast/form")] Task WithFormParam(MultipartItem formParam = null, [Body(BodySerializationMethod.UrlEncoded)] SomeQueryModel formParam = null);

Minimal API

As for now this tool supports Controllers API only. It should be updated to support Minimal API as well.

Use Existing DLL and not Build csproj (for Larger Solutions)?

Thank you for your efforts with this project ๐Ÿ™

Everything works well and I was able to generate the code for my application.

The only concern is build time. I experience this with EFCore migrations/commands, too, and it's rather frustrating. It takes about 90 seconds (or longer) for a build to occur, mostly because dotnet build does not leverage build acceleration.

Ideally, it would be valuable to have a parameter to use the existing .dll (if it can find it of course) and use that instead of rebuilding the project, which takes a lot of time for larger solutions.

Thank you for any consideration.

Generator dont check for query names

Lets say we have Action like this

GetThing(string language, [FromQuery(Name = "culture")] string? languageCulture)

It generates

GetThing(string language, string languageCulture = null);

which should be

GetThing(string language, [AliasAs("culture")]  string languageCulture = null);

Or

GetThing(string language, string culture= null);

Nullability operator in contracts implementation

Now i get

[Get("/some-api")]
Task<ListResponse> GetSome([AliasAs("page_number")] int? pagenumber = null, [AliasAs("date_types")] DateType[] dateTypes = null, [AliasAs("q")] string query = null);

It should add nullability operator ? on string and array too. It should work only on query params since they are optional.
It should be

[Get("/some-api")]
Task<ListResponse> GetSome([AliasAs("page_number")] int? pagenumber = null, [AliasAs("date_types")] DateType[]? dateTypes = null, [AliasAs("q")] string? query = null);

.Net 8 isnt supported

After upgrading project to .net8 it stopped working

Time Elapsed 00:00:02.12
Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.TypeInitializationException: The type initializer for 'System.Net.Quic.MsQuicApi' threw an exception.
 ---> System.TypeLoadException: Could not load type 'ManagedToUnmanagedOut' from assembly 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
   at Interop.Advapi32.RegOpenKeyEx(SafeRegistryHandle hKey, String lpSubKey, Int32 ulOptions, Int32 samDesired, SafeRegistryHandle& hkResult)
   at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
   at Microsoft.Win32.RegistryKey.OpenSubKey(String name)
   at System.Net.Quic.MsQuicApi.IsTls13Disabled(Boolean isServer)
   at System.Net.Quic.MsQuicApi..cctor()
   --- End of inner exception stack trace ---
   at System.Net.Quic.MsQuicApi.get_IsQuicSupported()
   at System.Net.Quic.QuicListener.get_IsSupported()
   at Microsoft.AspNetCore.Hosting.WebHostBuilderQuicExtensions.UseQuic(IWebHostBuilder hostBuilder)
   at Microsoft.AspNetCore.Hosting.WebHostBuilderQuicExtensions.UseQuic(IWebHostBuilder hostBuilder, Action`1 configureOptions)
   at Microsoft.AspNetCore.Hosting.WebHostBuilderKestrelExtensions.UseKestrel(IWebHostBuilder hostBuilder)
   at Microsoft.AspNetCore.Hosting.WebHostBuilderKestrelExtensions.UseKestrel(IWebHostBuilder hostBuilder, Action`2 configureOptions)
   at Microsoft.AspNetCore.WebHost.ConfigureWebDefaults(IWebHostBuilder builder)
   at Microsoft.Extensions.Hosting.GenericHostBuilderExtensions.<>c__DisplayClass1_0.<ConfigureWebHostDefaults>b__0(IWebHostBuilder webHostBuilder)
   at Microsoft.Extensions.Hosting.GenericHostWebHostBuilderExtensions.ConfigureWebHost(IHostBuilder builder, Func`3 createWebHostBuilder, Action`1 configure, Action`1 configureWebHostBuilder)
   at Microsoft.Extensions.Hosting.GenericHostWebHostBuilderExtensions.ConfigureWebHost(IHostBuilder builder, Action`1 configure, Action`1 configureWebHostBuilder)
   at Microsoft.Extensions.Hosting.GenericHostBuilderExtensions.ConfigureWebHostDefaults(IHostBuilder builder, Action`1 configure, Action`1 configureOptions)
   at Microsoft.Extensions.Hosting.GenericHostBuilderExtensions.ConfigureWebHostDefaults(IHostBuilder builder, Action`1 configure)
   at Product.Program.CreateHostBuilder(String[] args) in C:\src\Product\Program.cs:line 41
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at GenerateAspNetCoreClient.Command.ServiceProviderResolver.GetServiceProvider(Assembly assembly) in /home/runner/work/GenerateAspNetCoreClient/GenerateAspNetCoreClient/GenerateAspNetCoreClient.Command/ServiceProviderResolver.cs:line 62
   at GenerateAspNetCoreClient.Command.GenerateClientCommand.GetApiExplorer(Assembly assembly, String environment) in /home/runner/work/GenerateAspNetCoreClient/GenerateAspNetCoreClient/GenerateAspNetCoreClient.Command/GenerateClientCommand.cs:line 40
   at GenerateAspNetCoreClient.Command.GenerateClientCommand.Invoke(Assembly assembly, GenerateClientOptions options) in /home/runner/work/GenerateAspNetCoreClient/GenerateAspNetCoreClient/GenerateAspNetCoreClient.Command/GenerateClientCommand.cs:line 19
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at GenerateAspNetCoreClient.Program.CreateClient(GenerateClientOptions options) in /home/runner/work/GenerateAspNetCoreClient/GenerateAspNetCoreClient/GenerateAspNetCoreClient/Program.cs:line 34
   at GenerateAspNetCoreClient.Program.<>c.<Main>b__0_0(GenerateClientOptions options) in /home/runner/work/GenerateAspNetCoreClient/GenerateAspNetCoreClient/GenerateAspNetCoreClient/Program.cs:line 18
   at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
   at GenerateAspNetCoreClient.Program.Main(String[] args) in /home/runner/work/GenerateAspNetCoreClient/GenerateAspNetCoreClient/GenerateAspNetCoreClient/Program.cs:line 16

Error when running dotnet-generate-client

With version 1.1.0, I get the following exception when trying to run the dotnet-generate-client MyProject -o MyClient -n MyClient command.

Could not load type 'System.Net.Quic.QuicImplementationProviders' from assembly 'System.Net.Quic

It still runs fine on version 0.8.0, which I think is the last one that did not require the .Net 7.0 runtime. MyProject is a .Net 6.0 application.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.