skip to Main Content

We are for some time now trying to find a solution for server prerendering of SPA, specifically Angular4, for the purpose of SEO.

We have come to try and use aspnetcore-angular2-universal, which seems to be the perfect solution, however, we encounter problems deploying the published build to a local IIS server.

We have posted an issue regarding the problem on the issues page at which can be found here:
https://github.com/MarkPieszak/aspnetcore-angular2-universal/issues/491

We have followed the instruction under “Getting started” & “Deploy” (which can be found here: https://github.com/MarkPieszak/aspnetcore-angular2-universal) exactly but the error still exist.
The support is unresponsive on issues and thus we are posting also here.

The problem is (as mention in the issue linked here) that we get the following error:
enter image description here

Which indicates a problem with the web.config file. However the webconfig file is exactly as supplied in the starter project and seems also legit.
I should mention that building and running the project using npm build:prod and dotnet run works and we can lunch an in memory application from Visual Studio Code, however when taking the published folder to an IIS folder the error occurs.

Any help will be appreciated.

2

Answers


  1. Chosen as BEST ANSWER

    Aperantly there were incompebilities between angular5 & universal in serverside. The https://github.com/MarkPieszak/aspnetcore-angular2-universal seed was downgraded to using angular4.3 instead of 5. When we updated seed, the problem was solved.


    1. Did you installed .NET Core Windows Server Hosting bundle?
    2. Check if AspNetCoreModule listed in IIS => Modules. Sometimes it not installed properly during #1, even if there was “Succeeded” at all steps. In that case I just removing it via Program & Features, and reinstalling it then.
    3. Once I saw that error when manually copied web.config from sources over the publish folder. Problem is that original web.config contains placeholders like %LAUNCHER_PATH% and %LAUNCHER_ARGS%, which turns to appropriate values (dotnet and .YourApp.dll for instance) during dotnet publish
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search