0

I am having an issue deploying an ASP.NET Core app with Angular2 to IIS.

Steps so far -

  • Created a starter Angular2 asp.net core project with aspnetcore-spa generator following this
  • Played around with some angular code and was able to debug in VS2015 as well as command line. At this point the code is running
  • Got IIS setup following this
  • Using VS2015 published to a folder. Created a new IIS app and pointed to that folder.
  • Point the browser and get an error


An error occurred while processing your request.

Log file shows

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0] An unhandled exception has occurred: Call to Node module failed with error: To use prerendering, you must install the 'aspnet-prerendering' NPM package. System.Exception: Call to Node module failed with error: To use prerendering, you must install the 'aspnet-prerendering' NPM package.

The node_module folder with aspnet-prerendering is in the output folder.

One last thing to test that IIS is working, I created a basic project from VS template for .NET core and was able to get IIS working for a basic application. No npm dependencies.

Thanks for any direction on this.

1
  • After more digging and trying a bunch of things - I eventually set my credentials for the app pool and it worked. I thought I had tried it earlier without success, but might have been a combination with something else I did. I was also able to use LocalSystem - but not ApplicationPoolIdentity. Just for fun, I also renamed the aspnet-prerendering folder in node_modules in the output folder, which broke it even when running under my user (thought it might have been a path thing). Security rights is wide open in the output folder, so not sure at this point, but must be a security thing. Commented Aug 18, 2016 at 20:11

1 Answer 1

0

I had the same problem, and after a few hours of unsuccsessfull attempts to resolve the error I created a new ASP.NET Core Web Application from VS2015 templates and just copied all .json and webpack config files, both ClientApp and typings folders into it. Also I updated Views folder from my project. I didn't replace web.config (I think web.config may cause the problem, but I'm not sure). After these actions everything seems to be working properly.

Also, I added <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked> to my .xproj file because of this problem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.