我不断收到 StaticWebAssets.xml 构建错误,但我不想要它们

I keep getting StaticWebAssets.xml build error but I don't want them

我在 VS 2022 预览版或 dotnet build 中尝试构建时不断收到此错误(但在 VS 2019 中不会发生):

Severity Code Description Project File Line Suppression State Error MSB3030 Could not copy the file "C:\projects\■■■■\■■■■.StaticWebAssets.xml" because it was not found. ■■■■.■■■■.■■■■ C:\Program Files\Microsoft Visual Studio22\Preview\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 5100

问题是,这些 API 没有任何静态 Web 资产,我不想构建或部署静态 Web 资产。有没有办法让这个错误消失?

谢谢。

也许尝试“清洁解决方案”。在我这样做之后,我没有任何错误。