-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
Description
Moved from dotnet/sdk#898 on behalf of @AArnott
I'm working to port my CodeGeneration.Roslyn MSBuild extension to .netstandard so that it works under dotnet build. The design is that folks can build on my SDK NuGet package to write their Roslyn-based code generator, and then the end user chains in my build-time NuGet package which "discovers" these code generation extensions and loads the code generator assemblies to do the work on my scaffolding.
In the conversion, I hit two major roadblocks from .netstandard limitations:
Assembly.LoadFileis missing. I understand this is coming in .netstandard 2.0 but is there any supported alternative in the meantime for an MSBuild Task to load some assembly based on its path? I mean, MSBuild Core itself can do it, so how is that done so I can emulate it?- No AppDomain support. This is super useful for two reasons: I can control the version of Roslyn assemblies that are loaded to the ones I was compiled against, thus avoiding assembly load failures. It also lets me unload these extension assemblies when I'm done with them so they don't lock files on disk when the build is over (including VS in proc design-time builds). If MSBuild Core similarly keeps msbuild.exe processes running after a build, we have a significant problem, but if it doesn't, I might omit AppDomain support from just the .netstandard build of this MSBuild Task, then cross my fingers and hope for the best about the Roslyn assembly versions.
Thoughts?
swaroop-sridhar