Closed Aragas closed 5 months ago
The DevelopmentDependency flag will not work the way Vogen is currently setup. Vogen requires to ship Vogen.SharedTypes
, but the behaviour for DevelopmentDependency is to exclude the compile
part - the compiler will not be able to see those shared types.
Not sure if there's something else going on, except this
Oops! Thanks for spotting @Aragas - I'm doing a build now for the nuget issue. I'll take a look at the others later. The nuget issue should be fixed in 4.0.6
Re.
IVogen<TType, TValueType> is not assigned to the Vogen type in the autogenerated code, you need to manually assign it to the Vogen type like this
This is controlled by the StaticAbstractsGeneration
flag in global config. It is also only generated for projects using C# 11. What are you targetting?
Re.
IVogen<TType, TValueType> is not assigned to the Vogen type in the autogenerated code, you need to manually assign it to the Vogen type like this
This is controlled by the
StaticAbstractsGeneration
flag in global config. It is also only generated for projects using C# 11. What are you targetting?
.NET 8.
Looks like it doesn't work if you do not explicitly specify the <LangVersion>
tag, even if it's already implied it's past 11 with .NET 8.
Once I added <LangVersion>12</LangVersion>
it started to work
That's odd. I thought the behaviour of this was to default to latest
. I'll investigate that. I plan on adding an analyzer that spots usage on unsupported langversions.
Do you have a global.json
file? I'm just wondering why it's not 11
or more. When I run a .NET 8 app with no langversion
, it default to preview (presumably because it's being build with the .NET 9 SDK)
I'll release another version shortly that outputs a diganostics.cs
file.
Could you add this to your project and tell me what it says?
namespace Vogen;
public class __ProduceDiagnostics { }
The contents should look something like:
/*
LanguageVersion: Preview
User provided global config
===========
UnderlyingType: null
ValidationExceptionType: null
Conversions: Default
Customizations: None
DeserializationStrictness: Default
DebuggerAttributes: Default
Comparison: Default
StringComparers: Unspecified
ParsableForStrings: GenerateMethodsAndInterface
ParsableForPrimitives: HoistMethodsAndInterfaces
ToPrimitiveCasting: Explicit
FromPrimitiveCasting: Explicit
DisableStackTraceRecordingInDebug: False
TryFromGeneration: Unspecified
IsInitializedMethodGeneration: Unspecified
SystemTextJsonConverterFactoryGeneration: Unspecified
OpenApiSchemaCustomizations: GenerateSwashbuckleMappingExtensionMethod
StaticAbstractsGeneration: Unspecified
Resolved global config
===========
UnderlyingType: null
ValidationExceptionType: null
Conversions: Default
Customizations: None
DeserializationStrictness: Default
DebuggerAttributes: Full
Comparison: UseUnderlying
StringComparers: Omit
ParsableForStrings: GenerateMethodsAndInterface
ParsableForPrimitives: HoistMethodsAndInterfaces
ToPrimitiveCasting: Explicit
FromPrimitiveCasting: Explicit
DisableStackTraceRecordingInDebug: False
TryFromGeneration: GenerateBoolAndErrorOrMethods
IsInitializedMethodGeneration: Generate
SystemTextJsonConverterFactoryGeneration: Generate
OpenApiSchemaCustomizations: GenerateSwashbuckleMappingExtensionMethod
StaticAbstractsGeneration: Omit
Targets
===========
ForecastDate
City
Farenheit
Centigrade
CustomerName
OrderId
*/
@SteveDunn just to be sure, I assume there should have been a version 4.0.7 for that, right?
@SteveDunn just to be sure, I assume there should have been a version 4.0.7 for that, right?
@Aragas - it'll be in 4.0.6, which I'm just building now
@Aragas - sorry, yes, 4.0.7. On it's way to NuGet now! Thanks for the reports. Let me know if there's any issues.
Just to confirm, the diagnostics works. Also, without LangVersion property it does see now that it's 11 and adds the IVogen interface!
Excellent - great news - thanks for checking!
Hey Steve! Just started to use the new version, here's some issues discovered!
1. OpenAPI
When using
OpenApiSchemaCustomizations.GenerateSwashbuckleMappingExtensionMethod
TheVogenSwashbuckleExtensions
class is referencing the Vogen types without specifying a namespaceInstead of providing a full namespace
2. IVogen<,>
IVogen<TType, TValueType>
is not assigned to the Vogen type in the autogenerated code, you need to manually assign it to the Vogen type like this