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:
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
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.
AspNetCoreModule
listed inIIS => 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.%LAUNCHER_PATH%
and%LAUNCHER_ARGS%
, which turns to appropriate values (dotnet
and.YourApp.dll
for instance) duringdotnet publish