You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code generation is broken for the .Net472 target in the Vogen 4.0.4 package.
See the steps to reproduce.
Steps to reproduce
Program.cs
// See https://aka.ms/new-console-template for more informationusing Vogen;// Vogen | Net472 | Net8.0 |// ---------------------------------------// 4.0.4 | Compile Error | Ok |// 3.0.24 | Ok | Ok |[ValueObject(conversions:Conversions.None)]publicpartialclassMyValueObj{}
ConsoleApp\obj\Debug\net472\Vogen\Vogen.ValueObjectGenerator\SystemTextJsonConverterFactory_g.cs(27,54,27,58): error CS0234: The type or namespace name 'Json' does not exist in the namespace 'System.Text' (are you missing an assembly
Expected behaviour
Version 4.0.x continues to work as 3.0.x for .Net472
The text was updated successfully, but these errors were encountered:
Thanks for the bug report @dmitriyse ! Apologies, this is due to a new feature in 4.0 that generates a 'factory' of System.Text.Json converters. The purpose of which is to tell STJ at compile time what converters there are. This is used in STJ source generation.
By default, this is set to generate the converter factory. This wouldn't cause problems on .NET core (> 5.0) apps, as the package and types are included by default.
The generator now checks to see if STJ is included and doesn't generate anything if it isn't included.
Describe the bug
The code generation is broken for the .Net472 target in the Vogen 4.0.4 package.
See the steps to reproduce.
Steps to reproduce
Program.cs
ConsoleApp.csproj
Build Error:
Expected behaviour
Version 4.0.x continues to work as 3.0.x for .Net472
The text was updated successfully, but these errors were encountered: