I setup Nuget.Server based on Visual Studio Project and Nuget.Server Package, and publish it to our IIS on Windows Server 2019.
In Server, We can open the Website at http://ServerName:Port and everything is ok. but when we open this url from our clients, we got error:
Object reference not set to an instance of an object.
Therefore, we decide to enable debug on NugetServer App, and this is the full error:
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
<% if (Request.IsLocal || ServiceResolver.Current.Resolve<NuGet.Server.Core.Infrastructure.ISettingsProvider>().GetBoolSetting("allowRemoteCacheManagement", false)) { %>
[NullReferenceException: Object reference not set to an instance of an object.]
NuGet.Server.ServiceResolverExtensions.Resolve(IServiceResolver resolver) +50
ASP.default_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in D:\WebApps\AryaVtd-NugetServer\Default.aspx:37
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +275
System.Web.UI.Page.Render(HtmlTextWriter writer) +39
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4238
Server info: Windows Serve 2019, IIS, folder has security access enable for IIS_IUSER, Firewall is off for testing. Anonymous user is Enable on IIS and Impersonate is true.
Client info: Windows 10, Microsoft Edge, and user is domain user.
Thanks in Advance
I had the same problem (same symptoms and same exception). It appeared that the cause was that I created a VB ASP.NET project instead of the C# one by mistake. I don't think it's still actual for the question author, but I hope it helps someone.