QzL
QzL
CC#
Created by QzL on 4/25/2023 in #help
❔ Rosyln Analyzer with Nugget Package
4 replies
CC#
Created by QzL on 4/4/2023 in #help
❔ Incremental source generator not called with docker
Hello, I have 2 projects (simplified): - one sandbox .net6 - one SourceGenerator .netStandard2.0 In my SourceGenerator, I have a class called RestServicesSourceGenerator like this
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;

[Generator]
public sealed class RestServicesSourceGenerator
: IIncrementalGenerator
{
public RestServicesSourceGenerator()
{
}

void IIncrementalGenerator.Initialize(IncrementalGeneratorInitializationContext context)
{
// processing code
}
}
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;

[Generator]
public sealed class RestServicesSourceGenerator
: IIncrementalGenerator
{
public RestServicesSourceGenerator()
{
}

void IIncrementalGenerator.Initialize(IncrementalGeneratorInitializationContext context)
{
// processing code
}
}
And in my sandbox project, I have a reference of my SourceGenerator
<ProjectReference Include="..\..\project.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="true" />
<ProjectReference Include="..\..\project.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="true" />
When i start building my sandbox (from VS or from command line dotnet build --no-incremental), the IIncrementalGenerator.Initialize is executed and i can see my generated files. When i start building from docker using this image mcr.microsoft.com/dotnet/sdk:6.0 nothing happens. 😭 When i start building from azure pipepline using vmImage: 'ubuntu-latest' it's work 😅 If someone have an idea 🥹 Deps are :
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.5.0" PrivateAssets="all" />
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.5.0" PrivateAssets="all" />
#rosyln
52 replies