Closed CheloXL closed 1 year ago
Thanks for reporting, I'll try to get this fixed ASAP! A few questions:
string
(it's normally an int
)IsValid
is part of IValidEntityId
?Yes:
[assembly: VogenDefaults(
typeof(string),
Conversions.TypeConverter | Conversions.SystemTextJson | Conversions.EfCoreValueConverter,
customizations: Customizations.TreatNumberAsStringInSystemTextJson,
debuggerAttributes: DebuggerAttributeGeneration.Basic
)]
Correct. That interface has just the bool IsValid { get; }
property.
No. Just opening the solution gives me the error.
Thanks, I'm sure I'll spot it if it does occur on my Rider. I'm using 2023.1.3 (Build #RD-231.9161.46, built on June 21, 2023); where do you see this AD0001
error pop up?
There's obviously something wrong with that analyzer, as it's supposed to show this, but it only shows it when the type is on the attribute (and not in global config)
I'll continue looking!
I'm using 2023.2 EAP 9. EAP has a lot more information when source generators fail. In fact, it has a special debugger for source generators (of course you must have access to the source of the source generator and know what are you doing... a thing I'm not qualified in)
Getting somewhere - I now have an integration test that generates the error you're seeing:
Expected diagnostic:
// /0/Test0.cs(20,26,20,34): info AddValidationMethod: Type name 'TypeName' can have validation
VerifyCS.Diagnostic().WithSpan(20, 26, 20, 34).WithArguments("TypeName"),
Actual diagnostic:
// error AD0001: Analyzer 'Vogen.Rules.AddValidationAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'.
This is fixed in version 3.0.20 - just pushing to NuGet now. Thanks very much for the bug report - much appreciated!
Describe the bug
Using Rider, I'm getting the following error as a "warning" message:
There is nothing strange in the ValueObject, defined as following:
The solution is quite complex, so I don't think I can provide a simplified sample.
Steps to reproduce
Expected behaviour
No warning should be set, nor any error should occur.