101 Compilation Error for .NET Core Web Projects

MSB4063: the “Csc” task could not be initialized with its input parameters

MSB4064: The “SharedCompilationId” parameter is not supported by the “Csc” task. Verify the parameter exists on the task, and it is the settable public instance property

I encountered this issues await back when trying to creating new .NET Core web projects from VS2017. The diagnosis led me to a unique situation which the existing of the razor code that causes the compilation issue. I took a while to google around it and yet found any solution. What I observes is that people face the similar issue in related to the release of new .NET core SDK. I even attempted to modify the native .NET sdk compilation library but it didn’t work.

I decided to stop searching for existing solution. A few day past, it came in a sudden that it may work if I try to import the compiler library from .NET Core. And voila, it compiled without error 🙂

Solution:  Add Microsoft.Net.Compilers dependencies from NuGet to the web project.

 

Hope it help some of you unstuck on 101 error 😉