This issue can be reproduced with the following steps:
- Create a Blazor Wasm project for .NET 5.0 using this instruction: Microsoft Templates.
- Add the DevExpress.Blazor v20.1.8 NuGet package.
- Try to publish the project.
After these steps the following error is displayed:
Possible workaround:
Open the "C:\Users.nuget\packages\devexpress.blazor\20.1.8\build\Microsoft.AspNetCore.StaticWebAssets.props" file.
Remove the following code from this file:
Code<StaticWebAsset Include="$(MSBuildThisFileDirectory)..\staticwebassets\.gitignore">
<SourceType>Package</SourceType>
<SourceId>DevExpress.Blazor</SourceId>
<ContentRoot>$(MSBuildThisFileDirectory)..\staticwebassets\</ContentRoot>
<BasePath>_content/DevExpress.Blazor</BasePath>
<RelativePath>.gitignore</RelativePath>
</StaticWebAsset>
Publish the project again.