Step :1 Code: dotnet build E:\abc.csproj /p:Platform=ANYCPU /p:Configuration=Release . Error: C:\Program Files\dotnet\sdk\5.0.202\Microsoft.Common.CurrentVersion.targets(3624,5): error MSB3474: The tas k "SGen" is not supported on the .NET Core version of MSBuild. Use the Microsoft XML Serializer Generator p ackage instead. See https://go.microsoft.com/fwlink/?linkid=858594 for more information. [E:\abc.csproj]
Step:2 I had applied the below solution but didn't work. Command:dotnet add E:\abc.csproj package Microsoft.XmlSerializer.Generator -v 1.0.0
I had read a document and implement a solution but the solution has some issues. sp command: 'dotnet add E:\abc.csproj package Microsoft.XmlSerializer.Generator -v 1.0.0' Error: Determining projects to restore... Writing C:\Users\AppData\Local\Temp\tmpF1E.tmp info : Adding PackageReference for package 'Microsoft.XmlSerializer.Generator' into project 'E:\abc.csproj'. error: Error while adding package 'Microsoft.XmlSerializer.Generator' to project 'E:\abc.csproj'. The project does not support adding package references through the add package command.
Remove this line from the csproj file: