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.

The new templates have quite a bit more going on than templates in the past, which is a good thing. However, if I create a new project like dotnet new webapi -au Individual the current result is a little less than desirable.

If I do dotnet run I get the following error

Dans-MacBook-Air:Demo.Api dansiegel$ dotnet run

Unhandled Exception: System.InvalidOperationException: Unable to configure HTTPS endpoint. For information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054. ---> System.Collections.Generic.KeyNotFoundException: No certificate named 'HTTPS' found in configuration for the current environment (Production).
   at Microsoft.AspNetCore.CertificateLoader.LoadSingle(String certificateName)
   at Microsoft.AspNetCore.CertificateLoader.Load(IConfigurationSection certificateConfiguration)
   at Microsoft.AspNetCore.KestrelServerOptionsSetup.<>c__DisplayClass6_0.<BindEndPoint>b__0(ListenOptions listenOptions)
   --- End of inner exception stack trace ---
   at Microsoft.AspNetCore.KestrelServerOptionsSetup.<>c__DisplayClass6_0.<BindEndPoint>b__0(ListenOptions listenOptions)
   at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions.Listen(IPEndPoint endPoint, Action`1 configure)
   at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions.Listen(IPAddress address, Int32 port, Action`1 configure)
   at Microsoft.AspNetCore.KestrelServerOptionsSetup.BindEndPoint(KestrelServerOptions options, IConfigurationSection endPoint, CertificateLoader certificateLoader)
   at Microsoft.AspNetCore.KestrelServerOptionsSetup.BindConfiguration(KestrelServerOptions options)
   at Microsoft.AspNetCore.KestrelServerOptionsSetup.Configure(KestrelServerOptions options)
   at Microsoft.Extensions.Options.LegacyOptionsCache`1.CreateOptions()
   at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)
   at Microsoft.Extensions.Options.LegacyOptionsCache`1.get_Value()
   at Microsoft.Extensions.Options.OptionsManager`1.get_Value()
   at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.CreateServiceContext(IOptions`1 options, ILoggerFactory loggerFactory)
   at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer..ctor(IOptions`1 options, ITransportFactory transportFactory, ILoggerFactory loggerFactory)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(SingletonCallSite singletonCallSite, ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass17_0.<RealizeService>b__0(ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureServer()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
   at Demo.Api.Program.BuildWebHost(String[] args)
   at Demo.Api.Program.Main(String[] args)

If I try to deploy to an Azure Web App I get the following error:

HTTP Error 502.5 - Process Failure


Common causes of this issue:

The application process failed to start
The application process started but then stopped
The application process started but failed to listen on the configured port

Troubleshooting steps:

Check the system event log for error messages
Enable logging the application process’ stdout messages
Attach a debugger to the application process and inspect

For more information visit: http://go.microsoft.com/fwlink/?LinkID=808681

The templates really could use some sort of ReadMe added to them to help developers get started. For instance if I’m on a Mac what do I need to do to setup my local environment for testing. If I’m on my PC same thing… if I’m deploying to Linux, IIS, Azure…

Another thing would be following @RehanSaeed’s example and provide some action items of any tweaks or things that a developer should do next.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
danroth27commented, May 16, 2017
0reactions
mlorbetskecommented, May 25, 2017

Closing this as the UWP concerns are discussed in #770 and the item tracking the certificate generation utility is here https://github.com/aspnet/DotNetTools/issues/296. The approach seems to have changed a bit to now be an MSBuild task (source here).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Website Templates and Themes
You can choose from over 51900 website templates and themes on ThemeForest, created by our global community of independent designers and developers.
Read more >
Website Templates
Download HTML web templates and provide your users with some visual joy to brighten their day. Not big on visual joy? We have...
Read more >
Beautiful, Customizable Website Templates for Free
Create your dream website today with Canva's free, attractive, and professionally made website templates you can customize for any brand or business.
Read more >
1500+ Free HTML5 Website Templates 2023
Browse the best free business, portfolio, and blog HTML5 responsive website templates. Then customize your template in Webflow without code.
Read more >
Free HTML5 Website Templates
Choose from 800+ free designer-made website templates. Drag and drop to customize anything. Add advanced design features and professional business ...
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