RT0405
RT0405
CC#
Created by RT0405 on 10/22/2023 in #help
✅ is there a way to delete or overwrite a dll during the postbuild event?
I found a work around using msbuild tasks to move and delete the old one
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<ItemGroup>
<DLLName Include="$(OutDir)$(MSBuildProjectName).dll" />
</ItemGroup>
<Move SourceFiles="@(DLLName)" DestinationFiles="@(DLLName -> Replace('dll', 'dll2'))" />
<Exec Command="start ..\Velrdid.OpenXR.PostCompilerFixup\bin\Release\net6.0\Veldrid.OpenXR.PostCompileFixup.exe"/>
<Delete Files="@(DLLName -> Replace('dll', 'dll2'))" />
</Target>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<ItemGroup>
<DLLName Include="$(OutDir)$(MSBuildProjectName).dll" />
</ItemGroup>
<Move SourceFiles="@(DLLName)" DestinationFiles="@(DLLName -> Replace('dll', 'dll2'))" />
<Exec Command="start ..\Velrdid.OpenXR.PostCompilerFixup\bin\Release\net6.0\Veldrid.OpenXR.PostCompileFixup.exe"/>
<Delete Files="@(DLLName -> Replace('dll', 'dll2'))" />
</Target>
and the il weaver reads from the dll2 file and outputs to a normal dll with the same name
3 replies