ASP.NET CORE 2.1 Preview “SharedCompilationId” parameter is not supported by the “Csc” task

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


ASP.NET CORE 2.1 Preview “SharedCompilationId” parameter is not supported by the “Csc” task



I am trying run the project with views in separate class library on Mac OSX as described in below article



https://blogs.msdn.microsoft.com/webdev/2018/03/01/asp-net-core-2-1-razor-ui-in-class-libraries/



The problem is that I cannot build the class library project with Visual Studio Community 7.4 on Mac OS.



Project builds with command line (donet build) without problems but when I try to build it with Visual Studio it throws two errors:



/usr/local/share/dotnet/sdk/NuGetFallbackFolder/microsoft.aspnetcore.razor.design/2.1.0-preview1-final/build/netstandard2.0/Microsoft.AspNetCore.Razor.Design.Compilation.targets(10,10): Error MSB4064: The "SharedCompilationId" parameter is not supported by the "Csc" task. Verify the parameter exists on the task, and it is a settable public instance property. (MSB4064)


/usr/local/share/dotnet/sdk/NuGetFallbackFolder/microsoft.aspnetcore.razor.design/2.1.0-preview1-final/build/netstandard2.0/Microsoft.AspNetCore.Razor.Design.Compilation.targets(10,10): Error MSB4064: The "SharedCompilationId" parameter is not supported by the "Csc" task. Verify the parameter exists on the task, and it is a settable public instance property. (MSB4064)



/usr/local/share/dotnet/sdk/NuGetFallbackFolder/microsoft.aspnetcore.razor.design/2.1.0-preview1-final/build/netstandard2.0/Microsoft.AspNetCore.Razor.Design.Compilation.targets(5,5): Error MSB4063: The "Csc" task could not be initialized with its input parameters. (MSB4063)


/usr/local/share/dotnet/sdk/NuGetFallbackFolder/microsoft.aspnetcore.razor.design/2.1.0-preview1-final/build/netstandard2.0/Microsoft.AspNetCore.Razor.Design.Compilation.targets(5,5): Error MSB4063: The "Csc" task could not be initialized with its input parameters. (MSB4063)



When I change RazorCompileOnBuild to false or remove Content from Content Build project compiles without errors.





I haven't tried the preview yet, but I'd imagine it's a tooling issue. Once 2.1 is released, Visual Studio will definitely have been updated as well to align with this, but for the time being, it would seem the current version is not capable. You might be able to get it to work if you run it in an instance of Visual Studio from the preview channel, i.e. the tooling may already be present there.
– Chris Pratt
Mar 8 at 14:45





Did you ever get this figured out? I am bumping up against the same issue.
– Chuck Conway
Jun 4 at 21:45




4 Answers
4



Go to Nuget Console and add:



Install-Package Microsoft.Net.Compilers -Version 2.8.2


Install-Package Microsoft.Net.Compilers -Version 2.8.2



You will no longer get above mentioned error.



I had this problem on the build server but not locally.



The solution:
Install the updated Visual Studio on the build server. In my case 2017.15.4



In my case, I had installed the .NET Core 2.1 SDK, but not the runtime.



Strange how Microsoft don't include the runtime in the SDK.



If you face this problem there are three steps you need to take:






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Stripe::AuthenticationError No API key provided. Set your API key using “Stripe.api_key = ”

CRM reporting Extension - SSRS instance is blank

Keycloak server returning user_not_found error when user is already imported with LDAP