IIt worked on the build server, after I added 2this Nuget-Packages package:
Microsoft.AspNetCore.Razor.Design
Microsoft.NET.Sdk.Razor
Since I added the Net.SDK.Razor package, it builds successfully.
I had also added the Razor.Design package firstMicrosoft.AspNetCore.Razor.Design
, so I'm not sure if that one wasbut only Microsoft.NET.Sdk.Razor
is actually needed.