CSharpShellApp icon indicating copy to clipboard operation
CSharpShellApp copied to clipboard

Sourcegenerator question

Open sedoLevi609 opened this issue 1 year ago • 1 comments

Can I use Sourcegenerator in your app? If yes, how?

(link: https://learn.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/source-generators-overview)

I tried but nothing happens

My code in Program(SourceGenerator same as in link example):

namespace Test;

partial class Program { static void Main(string[] args) { HelloFrom("Generated Code"); }

static partial void HelloFrom(string name);

}

For the SourceGenerator I created console project, but set TargetFramework to netstandard2.0 manually(just modified csproj file)

Added this to main program csproj(with right path):

Screenshot_20230312_151621_com huawei browser

sedoLevi609 avatar Mar 12 '23 12:03 sedoLevi609

It is mostly a build tools feature instead of Roslyn feature, so I will have to implement it explicitly. Also pretty sure this needs to be supported first.

radimitrov avatar Mar 20 '23 13:03 radimitrov