You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure if this belongs in the msbuild or project-system repository (since this not dotnet specific), but I have some questions on DesignTime build, NuGet Restore, IntelliSense interactions with code generation.
Since this sounds/looks like a generic problem (with code generation) my questions are:
is there a good example on how to "correctly" implement MSBuild DesignTime logic and code generation when depending on NuGet packages for input and/or MSBuild Targets
is there documentation that explains this consistently (I found snippets here and there and some blogpost, but nothing definitive on the total overview for this scenario)
is there a way to trigger a DesignTime build after Restore is done? (if that is how it should be done)
is there a way to trigger a DesignTime build if input file changes (so new generated files can be indexed by IntelliSense)
Some more detailed information on the scenario:
an Assembly project with custom code generation
the custom code generator is "implemented" with an MSBuild Sdk
after generating source files, these are added to the relevant Compile ItemGroup depending on language (c#/c++)
the input for the code generator is typically stored in the project folder, but there is also a "type-import" mechanism that depends on other xml files acquired through a PackageReference (nuget package)
the generated code (filenames) depends on the (imported) input
we want IntelliSense on the generated code
this implies we need to do "something" during DesignTime builds, so IntelliSense knows about the generated files
"consumers" of the generated Assembly are within the same solution
We currently implemented the "IntelliSense support" by actually running the code generator during the DesignTime build.
This works fine when code generation is not using "type-import" (since the input is self-contained).
However it seems to "break" when needing "type-import":
the DesignTime build seems to run before (or parallel) to NuGet Restore on a clean solution. The code generation fails and causes some follow-up errors (which it does not seem to be able to recover from)
manual workaround is restoring the solution before opening up visual studio
Hope this all makes sense a bit.
The text was updated successfully, but these errors were encountered:
jjmew
transferred this issue from dotnet/project-system
Nov 6, 2020
Hello,
I am not sure if this belongs in the msbuild or project-system repository (since this not dotnet specific), but I have some questions on DesignTime build, NuGet Restore, IntelliSense interactions with code generation.
Since this sounds/looks like a generic problem (with code generation) my questions are:
Some more detailed information on the scenario:
We currently implemented the "IntelliSense support" by actually running the code generator during the DesignTime build.
This works fine when code generation is not using "type-import" (since the input is self-contained).
However it seems to "break" when needing "type-import":
Hope this all makes sense a bit.
The text was updated successfully, but these errors were encountered: