We are currently using VS extensions to create CUDA PTX files while developing in VS. The CUDA code is placed in the solution as a single file with the cu-extension. The extension hooks in into the save routine and any time the developer saves the CUDA code our extension hooks in compiles the CUDA code to PTX code and creates wrappers around and for this CUDA to make the CUDA code managable in C#. The extension creates 3 additional files (original filename for example: Filter3D), the PTX (filename: Filter3D.ptx) code that is embedded as "Embedded Resource" the wrapper code (filename: Filter3D.designer.cs) and some user-definable code (filename: Filter3D.cs).
This all works fine so far, but the problem is that there can only exist one version of an extension. So if we go bag to older versions of our code, the extension does not fit and compiles code that is not compatible with the current code version.
The idea was that something similar can be achieved by nuget packages that are "installed" alongside with the current code version as PackageReference in the C#-project. As this is also done with analyzer and source generators.
My problem is that I have no good clue where to start and where to search for.