Chik3r
✅ Output TaskParameter is unrecognized
it's probably not the best or correct way to do what I want
I have a list of items with a
ProjectPath
metadata (that then gets converted to a ProjectReference
), and I want to filter _ResolvedProjectReferencePaths
to only those that exist in my list (so that I can then get the referenced projects' compiled dll file)
I found this (https://stackoverflow.com/questions/42403046/msbuild-itemgroup-intersection) and this (https://learn.microsoft.com/en-us/archive/blogs/msbuild/batching-brainteaser-explained) to get the intersecting items, but I have the issue with CreateItem10 replies
Custom MSBuild task fails to load `System.Runtime`
Solved my issue
My build task is
ProjectReference
d by a net6.0
project that copies references to a custom folder, and it then passes a .targets
file to other projects for them to use the build task. Since the custom task was using <PackageReference Include="SixLabors.ImageSharp" />
, the reference was passed along to the net6.0
project which instead of using the netstandard2.0
version of ImageSharp used the netcoreapp3.1
version of ImageSharp. That version was then copied next to the BuildTools.dll
file so that the references to ImageSharp were resolved. As it was the netcoreapp3.1
version, it failed when building from VS (since it uses net framework), so it threw the system.runtime error.
I fixed this by adding PrivateAssets="all"
to the ImageSharp PackageReference
(in the custom build tool project), adding a <PackageReference Include="SixLabors.ImageSharp" Version="2.1.5" GeneratePathProperty="true" PrivateAssets="all" ExcludeAssets="all" />
just to get the path to the dll of imagesharp, and then adding a copy task to copy the netstandard2.0
dll next to the BuildTools.dll
(<Copy SourceFiles="$(PkgSixLabors_ImageSharp)\lib\netstandard2.0\SixLabors.ImageSharp.dll" DestinationFolder="$(_ActualOutputDirectory)/Libraries/tModLoader.BuildTools/1.0.0/" SkipUnchangedFiles="True" />
)10 replies