This commit is contained in:
2025-10-03 19:37:52 +08:00
parent 5e36931536
commit c0157a7e91
8 changed files with 69 additions and 17 deletions
+13 -7
View File
@@ -1,9 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.13.0" />
</ItemGroup>
<PropertyGroup>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.13.0" />
</ItemGroup>
</Project>
+2 -2
View File
@@ -10,8 +10,8 @@ namespace MySourceGenerator {
sb.AppendLine("using System;");
sb.AppendLine("namespace Generated;");
sb.AppendLine("public static class HelloWorld {");
sb.AppendLine(" public static void SayHello() {");
sb.AppendLine(" Console.WriteLine(\"Hello World!!!\");");
sb.AppendLine(" public static string SayHello() {");
sb.AppendLine(" return \"Hello World!!!\";");
sb.AppendLine(" }");
sb.AppendLine("}");