Hi @Anonymous ,
Welcome to Microsoft Q&A!
Which version of Visual Studio are you using?
Based on my testing, the default version of Microsoft.CodeDom.Providers.DotNetCompilerPlatform is version 2.0.1.
If you want to update the default NuGet package, you need to update the project template itself. You can refer to the Xavier Decoster's blog.
But it is not recommended that you do this. It is risky, because manual updates might corrupt the template if the latest version of all dependencies are not compatible with each other.
And I suggest you update the NuGet package from Manage NuGet Pacages.
Sincerely,
Anna
*
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.