Hello @vaishali tyagi ,
Welcome to Microsoft Q&A forum.
Can you confirm that this file bin\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.xml
exists?
I suggest first try to clean project cache(remove/rename .vs/bin/obj folders) and rebuild then publish your project again.
Please also try to install/update following NuGet package => Microsoft.CodeDom.Providers.DotNetCompilerPlatform (right-click your project/Manage NuGet Packages/Switch to Browse tab/search and install it).
If above methods don’t work, please try to clean NuGet cache by following this document: Clearing local folders and restore NuGet packages => rebuild => publish your project.
In case the issue is caused by Visual Studio, please try to reset VS settings(run devenv /ResetSettings
in Developer Command Prompt for Visual Studio 2022 Community
) and if this issue can be reproduced in newly created projects, please let us know.
BTW, please check if there's any related reference/nuget package which need to be updated to a higher version.
Feel free to let us know the results.
Sincerely,
Tianyu
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.