Reputation: 532
I am building multiple target frameworks in a single .net 6 project: net461 and net6.0. The two target frameworks build concurrently in Visual Studio as expected. Oddly, my net6.0 post-build event depend on the net461 post-build event. I have not found a way for the msbuild targets for one target framework to be dependent on those of another target framework. So I can't ensure the post-build events execute in the proper sequence.
After looking at mechanisms in msbuild to affect build target order and dependencies, I'm not finding an answer. I'm almost about to mess around with generating and waiting for lock files in my builds but was hoping not to need to. Any ideas?
Why my net6.0 build depends on my net461 build: I am using COM in .net 6 to expose functionality to a legacy COM client. This works but there is currently no tool to generate a TLB file for .net core that I need. (regasm.exe works for .net framework but not .net core.) One workaround is to build the same COM classes/interfaces, possibly stubbed, in .net framework to then generate the TLB file. This is what I do, and then use it in my net6.0 post-build event.
Upvotes: 0
Views: 1129