ligershark / WebOptimizer

A bundler and minifier for ASP.NET Core
Apache License 2.0
750 stars 113 forks source link

MSBuild MSB4120 message with dotnet publish and SDK 7.0.401 #286

Closed randyshoopman closed 9 months ago

randyshoopman commented 9 months ago

After upgrading to SDK 7.0.401 I'm now seeing this message when doing a dotnet publish:

....
Adding WebOptimizer cache files to publish output
C:\Users\rshoopman\.nuget\packages\ligershark.weboptimizer.core\3.0.384\build\LigerShark.WebOptimizer.Core.targets(13,9): message : MSB4120:
Item 'DotNetPublishFiles' definition within target references itself via (qualified or unqualified) metadatum 'Filename'. This can lead to un
intended expansion and cross-applying of pre-existing items. More info: https://aka.ms/msbuild/metadata-self-ref [C:\Users\rshoopman\source\r
epos\...\REDACTED.csproj]
...

For some extra context the project targets .net 7 and uses Typescripts files which msbuild compiles into js files.

I also noticed that those JS files (created from TS) were not getting bundled at runtime, unless I first ran dotnet build in my CI pipeline.

Thanks

randyshoopman commented 9 months ago

Looks like maybe this was already addressed by #285