Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Problem deploying an almost unmodified template Core website to IIS #861

Closed
georgiosd opened this issue Oct 10, 2016 · 3 comments
Closed

Comments

@georgiosd
Copy link

Platform: Windows Server 2012 R2
Template: New AngularJS 2 template (but this is unrelated to AngulaJS itself)
Configuration:

  • Installed HTTP Platform Handler
  • Installed ASP.NET Core Hosting package
  • Created IIS site with "No managed code" setting
  • Create registry keys for Data Protection using the PS script
  • Deployed from VStudio 2015

Log:

Hosting environment: Production
Content root path: C:\inetpub\wwwroot-apps
Now listening on: http://localhost:29320
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://apps.xxxxx.net/  
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]
      Executing action method BlackCat.Web.Apps.Controllers.HomeController.Index (BlackCat.Web.Apps) with arguments () - ModelState is Valid
info: Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ViewResultExecutor[1]
      Executing ViewResult, running view at path /Views/Home/Index.cshtml.
info: Microsoft.Extensions.DependencyInjection.DataProtectionServices[0]
      User profile not available. Using 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\4.0.30319.0\AutoGenKeys\S-1-5-82-318902610-198499900-729026145-4230401714-2662348488\DataProtection' as key repository and Windows DPAPI to encrypt keys at rest.
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]
      An unhandled exception has occurred: The system cannot find the file specified
System.ComponentModel.Win32Exception: The system cannot find the file specified
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.LaunchNodeProcess(ProcessStartInfo startInfo)
   at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance..ctor(String entryPointScript, String projectPath, String[] watchFileExtensions, String commandLineArguments, ILogger nodeOutputLogger, IDictionary`2 environmentVars, Int32 invocationTimeoutMilliseconds, Boolean launchWithDebugging, Int32 debuggingPort)
   at Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance..ctor(String projectPath, String[] watchFileExtensions, ILogger nodeInstanceOutputLogger, IDictionary`2 environmentVars, Int32 invocationTimeoutMilliseconds, Boolean launchWithDebugging, Int32 debuggingPort, Int32 port)
   at Microsoft.AspNetCore.NodeServices.NodeServicesFactory.CreateNodeInstance(NodeServicesOptions options)
   at Microsoft.AspNetCore.NodeServices.NodeServicesFactory.<>c__DisplayClass0_0.<CreateNodeServices>b__0()
   at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.CreateNewNodeInstance()
   at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.GetOrCreateCurrentNodeInstance()
   at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.<InvokeExportWithPossibleRetryAsync>d__10`1.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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.AspNetCore.SpaServices.Prerendering.PrerenderTagHelper.<ProcessAsync>d__33.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.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>d__0.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 AspNetCore._Views_Home_Index_cshtml.<ExecuteAsync>d__31.MoveNext() in /Views/Home/Index.cshtml:line 2
--- 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.Mvc.Razor.RazorView.<RenderPageAsync>d__14.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.Mvc.Razor.RazorView.<RenderAsync>d__13.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.Mvc.ViewFeatures.ViewExecutor.<ExecuteAsync>d__18.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.Mvc.ViewResult.<ExecuteResultAsync>d__26.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.Mvc.Internal.ControllerActionInvoker.<InvokeResultAsync>d__32.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.Mvc.Internal.ControllerActionInvoker.<InvokeResultFilterAsync>d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeAllResultFiltersAsync>d__29.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.Mvc.Internal.ControllerActionInvoker.<InvokeResourceFilterAsync>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeAsync>d__18.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.Builder.RouterMiddleware.<Invoke>d__4.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.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]
      Executing action method BlackCat.Web.Apps.Controllers.HomeController.Error (BlackCat.Web.Apps) with arguments () - ModelState is Valid
info: Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ViewResultExecutor[1]
      Executing ViewResult, running view at path /Views/Shared/Error.cshtml.
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
      Executed action BlackCat.Web.Apps.Controllers.HomeController.Error (BlackCat.Web.Apps) in 190.0162ms
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 2203.9959ms 500 text/html; charset=utf-8
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://apps.xxxxx.net/dist/vendor.css?v=vMW1VM_0TXEUWngxODEOOZ1kt4pDbNsp8u8QCA0ys90  
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[6]
      The file /dist/vendor.css was not modified
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 18.5423ms 304 text/css
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://apps.xxxxx.net/favicon.ico  
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/favicon.ico'. Physical path: 'C:\inetpub\wwwroot-apps\wwwroot\favicon.ico'
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 14.0092ms 200 image/x-icon
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://localhost:29320/  
fail: Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware[0]
      'MS-ASPNETCORE-TOKEN' does not match the expected pairing token '0682d2d8-88b2-4765-9d66-923ee6449b16', request rejected.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 0.6964ms 400 
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://localhost:29320/favicon.ico  
fail: Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware[0]
      'MS-ASPNETCORE-TOKEN' does not match the expected pairing token '0682d2d8-88b2-4765-9d66-923ee6449b16', request rejected.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 0.1473ms 400 

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.Dispose(Boolean disposing)
   at Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance.Dispose(Boolean disposing)
   at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.Finalize()

Questions:

  1. Why does it fail and what file can it not find? (obvious)
  2. Why does it seem to bind to a random localhost port??
  3. Is the "User profile not available. Using registry" info line a problem??
@georgiosd
Copy link
Author

OK, some different Googling lead me to this - http://stackoverflow.com/questions/38223432/cannot-run-asp-net-core-angular-2-server-side-rendering-project-in-server

Installing NodeJS and restarting server fixed it.

@LovedByTheLord
Copy link

@georgiosd, thanks so much for posting your solution! I was having the same problem. I hadn't restarted the server after installing node. Rebooting fixed the issue.

@georgiosd
Copy link
Author

@LovedByTheLord If only I had a penny for every time I didn't try the obvious :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants