Home
Options

ASP.NET Core SpaProxy is not working in newer LINQPad 6 version

Following code:

// Install nuget package: Microsoft.AspNetCore.SpaServices.Extensions
WebHost
    .CreateDefaultBuilder()
    .Configure(app => app.UseSpa(x => x.UseProxyToSpaDevelopmentServer("https://www.baidu.com")))
    .UseUrls("https://+:55555")
    .Build()
    .RunAsync(QueryCancelToken)

Cannot be running in current LINQPad 6, I'm pretty sure it can be running before, the error message is:

Application startup exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.AspNetCore.Builder.SpaApplicationBuilderExtensions.UseSpa(IApplicationBuilder app, Action`1 configuration)
   at UserQuery.<>c.<Main>b__4_0(IApplicationBuilder app) in C:\Users\sdfly\AppData\Local\Temp\LINQPad6\_zmnivmoh\fpgcpy\LINQPadQuery:line 3
   at Microsoft.AspNetCore.Hosting.WebHostBuilderExtensions.<>c__DisplayClass0_0.<Configure>b__0(WebHostBuilderContext _, IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.WebHostBuilderExtensions.<>c__DisplayClass2_1.<Configure>b__2(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.DelegateStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.WebHost.BuildApplication()
crit: Microsoft.AspNetCore.Hosting.WebHost[6]
      Application startup exception
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.AspNetCore.Builder.SpaApplicationBuilderExtensions.UseSpa(IApplicationBuilder app, Action`1 configuration)
   at UserQuery.<>c.<Main>b__4_0(IApplicationBuilder app) in C:\Users\sdfly\AppData\Local\Temp\LINQPad6\_zmnivmoh\fpgcpy\LINQPadQuery:line 3
   at Microsoft.AspNetCore.Hosting.WebHostBuilderExtensions.<>c__DisplayClass0_0.<Configure>b__0(WebHostBuilderContext _, IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.WebHostBuilderExtensions.<>c__DisplayClass2_1.<Configure>b__2(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.DelegateStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.WebHost.BuildApplication()


6NullReferenceException4 
Object reference not set to an instance of an object. 

Comments

Sign In or Register to comment.