The “Csc” task could not be initialized with its input parameters

L’altra sera ho voluto provare a creare un progetto “ASP.NET Core Web Application” (V2.2) utilizzando “Angular” come Template. Buona idea? Cattiva idea? Non lo, ma la strada non è stata così diretta.

The “Csc” task could not be initialized with its input parameters.

La creazione è andata subito a buon fine, ma l’errore era dietro l’angolo ed alla prima compilazione si è presentato col seguente messaggio:

MSB4063 The “Csc” task could not be initialized with its input parameters.

Preso dallo sconforto e dal pensiero “E’ un chiaro segnale che non debba fare nulla di FrontEnd” ho cominciato ad indagare e la soluzione è stata davvero semplice.

Microsoft.Net.Compilers

Per risolvere il problema è bastato installare il pacchetto “Microsoft.Net.Compilers” con relative dipendenze tramite nuget. Una volta terminato mi è bastato premere F5 per vedere il sito web aprirsi sul mio localhost.

Install-Package Microsoft.Net.Compilers -Version 3.2.1

Se vi state domandando a cosa serve il pacchetto appena indicato e dove trovarlo ecco tutti i riferimenti che fanno al caso vostro

.NET Compilers package. Referencing this package will cause the project to be built using the specific version of the C# and Visual Basic compilers contained in the package, as opposed to any system installed version.

This package can be used to compile code targeting any platform, but can only be run using the desktop .NET 4.7.2+ Full Framework.

Link: Microsoft.Net.Compilers