Replies: 2 comments 2 replies
-
The library is essentially just creating extra source code (source generated files). You can emit the source generated files to see if the files look correct. <!-- file: project.csproj -->
<PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
</PropertyGroup> This will emit source generated files to the Remember to clean up the solution My source for this: https://andrewlock.net/creating-a-source-generator-part-6-saving-source-generator-output-in-source-control/#controlling-the-output-location Side noteI have noticed that a minimal api uses source generated files when mapping api-endpoints. The problem is source generated files in the same project cannot see each others source generated files. Example: A minimal api project that defines Both So How I avoid this is by declaring an empty partial file like so: // First actual entity
[Partial]
public record Entity { }
// Create an empty partial file so that minimal api endpoint can see the type.
public partial record PartialEntity { } Other than that, I cannot really say what is wrong with your specific use case without more info. Of course there could be a bug in the source code |
Beta Was this translation helpful? Give feedback.
-
Thank you for the response. After multiple attempts made over different days, it has now started generating the code. I practically didn’t do anything except remove and reinstall the package, try to connect it to all the projects in the solution, and other attempts. Now, the classes are being generated both in the boot project and in the secondary ones. Thank you. |
Beta Was this translation helpful? Give feedback.
-
Is there a way to debug the library's execution? In my web solution, I can't get it to work when I use it in a DLL library project, though it works when used from the main console project. When creating a new test solution, it also works from a DLL library, so there must be some conflict within my web solution, but I'm not sure what to check.
Thankyou
Beta Was this translation helpful? Give feedback.
All reactions