Closed LittleLittleCloud closed 3 weeks ago
You need to use
<PackageReference Include="AutoSDK.SourceGenerators" Version="0.24.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
instead
<PackageReference Include="AutoSDK" Version="0.24.0" />
Thanks @HavenDV , The source generator is corrected added by updating the reference package to AutoSDK.SourceGenerators
. It successfully generate source code when I compile from dotnet cli. However, it fails to generate code in VS. I feel like it's more likely to be a bug on VS side and I created an issue for this bug in dotnet runtime repo. If you are also interested in details information, here is the link: https://github.com/dotnet/runtime/issues/108164.
Please also try to use latest dev version
Sometimes this problem can also go away if you clear the obj/bin directories, completely close VS, rebuild the project in different orders :)
I think it's issue on my side, recently I renamed project but don't test well source generation way
I checked the possible problem(missing files in nuget package) and it was not confirmed, so I recommend just trying the solution above
This is how I refer
AutoSDK
from my.csproj
fileAnd I expected to see
WebAPI.Generated.OpenAI
get generated from AutoSDK, but found nothing in analyzer node.Do I need any extra setup before using AutoSDK as source generator?