I have one Windows 7 machine that throws "Object reference not set to an instance of an object" when ASP.NET tries to start up. I have 2 other Windows 7 machines and a Windows 10 machine where this same code works fine. It would appear that something about that machine won't let ASP.NET startup, but I don't know why. I have tried turning off Windows firewall, turned off his anti-virus software, put files in a different folder in case of weird permissions issues, tried changing to non-SSL server, and nothing I can think of will fix this issue with this one machine. The worst part about this is that the error is happening inside the WebHostBuilder's Run function so I can't really see why it is doing it.
This computer cannot run ASP.NET Core no matter whether it is my project or a fresh ASP.NET Core .NET 4.52 project, so I know that it has nothing to do with my code. My guess is that I could reformat that Windows 7 machine and reinstall Windows 7 and it probably would work fine, but I really would like to know why it is failing instead. I am wary of going to production if a certain percentage of computers simply cannot run my software especially since I don't know how often this will happen.
Anyone have any ideas what I could try to resolve this? A null reference exception is so vague I am at a loss about where to go from here.
Stack trace for outer exception:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait(TimeSpan timeout)
at Microsoft.AspNetCore.Server.Kestrel.Internal.KestrelEngine.DisposeListeners(List1 listeners)
at Microsoft.AspNetCore.Server.Kestrel.Internal.KestrelEngine.CreateServer(ServerAddress address)
at Microsoft.AspNetCore.Server.Kestrel.KestrelServer.Start[TContext](IHttpApplication
1 application)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.Start()
at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host, CancellationToken token, String shutdownMessage)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host, CancellationToken token)
at DBA.Server.ServerAppService.b__1_0()
Stack trace for inner exception:
at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Listener.d__11.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.ListenerPrimary.d__19.MoveNext()
Sorry about stack trace formatting...
Edit 4: I have reformatted my question now that I know the machine in question fails even when none of my code is involved and I am running the standard ASP.NET Core project template.