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.

ConfigurationBuilder in Startup.cs Causes Freeze

See original GitHub issue

I have the following code with my Startup.cs to load configuration settings from appsettings.json: IConfigurationRoot config = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json").Build();

If I comment this code out and run dotnet electronize start, everthing runs normally. But with this code in place, when I run dotnet electronize start, package manager starts working through compiling but then hangs here in package manager:

Invoke electron.cmd - in dir: C:\Users\TEST\Documents\Visual Studio 2017\Projects\TESTElecNet\TEST\TEST\obj\Host\node_modules.bin Microsoft Windows [Version 6.3.9600] © 2013 Microsoft Corporation. All rights reserved.

C:\Users\Pete\Documents\Visual Studio 2017\Projects\TESTElecNet\TEST\TEST\obj\Host\node_modules.bin>electron.cmd “…..\main.js”

stdout: Use Electron Port: 58008

Any ideas? Thanks for your help!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
zlspjpcommented, Nov 8, 2017

Hi Robert,

I tried your sample and it works! Thanks so much for your help. I really like what you guys have done here. Thank you for sharing it with us.

Regards, Pete

0reactions
robertmuehsigcommented, Nov 7, 2017

I enhanced my sample and access the appsettings, which is more or less the same thing as accessing the connectionString and it worked without problems, but I used the new ASP.NET Core 2.0 “style”. Could you take a look at our sample and see if this helps?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Net Core app stuck hanging/loading on startup with out of ...
After doing some research I've found out that most of this errors are caused by some code in the "Program.cs" class. And indeed...
Read more >
Resolving ASP.NET Core Startup class from the DI container
In ASP.NET Core, the most common setup is characterized by having a standalone Startup class, responsible for bootstrapping the services ...
Read more >
Essential .NET 6 app settings tips... master developer and ...
Within Startup , I add a class called ApplicationSettingsBuilder.cs , or, something similar. Within this class, I add all the code to read ......
Read more >
C# Hard Truths: Program.cs was a Lie, Startup.cs is ... - YouTube
Program.cs was a lie up until .NET 6. Startup. cs was a waste of space. Microsoft forgot about DRY for years. Those are...
Read more >
New in ASP.NET Core 3: Service provider validation
1. Controller constructor dependencies aren't checked. The reason the validation feature doesn't catch this problem is that controllers aren't ...
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