System.Guid & GENERIC ERROR: Object reference not set to an instance of an object.
See original GitHub issueAfter trying to apply some new model changes today, TypeGen was giving me the following errors. I’m not sure how to trace it down. Possibly related is that it still has a problem with System.Guid
(first stack), but even after I overrode all those to TsType.String
, TypeGen gave the second error.
(I know this is not much to go on, but I’m at wit’s end. If you want me to look for particular things in our update to debug this, I’ll certainly oblige.)
APPLICATION ERROR: Generated type must be either a C# class or enum. Error when generating type System.Guid
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateType(Type type)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateType(Type type)
at TypeGen.Core.Generator.Generate(Type type)
at TypeGen.Core.Generator.Generate(Assembly assembly)
at TypeGen.Cli.Program.<>c__DisplayClass10_0.<Generate>b__0(IEnumerable`1 acc, Assembly assembly)
at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)
at TypeGen.Cli.Program.Generate(String projectFolder, String configPath, Boolean verbose)
at TypeGen.Cli.Program.Main(String[] args)
GENERIC ERROR: Object reference not set to an instance of an object.
at TypeGen.Core.Extensions.TypeExtensions.<>c__DisplayClass0_0.<GetInterface>b__0(Type i)
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at TypeGen.Core.Extensions.TypeExtensions.GetInterface(Type type, String name)
at TypeGen.Core.Business.TypeService.IsDictionaryType(Type type)
at TypeGen.Core.Business.TypeService.IsCollectionType(Type type)
at TypeGen.Core.Business.TypeService.GetFlatType(Type type)
at TypeGen.Core.Business.TypeDependencyService.GetMemberTypeDependencies(Type type)
at TypeGen.Core.Business.TypeDependencyService.GetTypeDependencies(Type type)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateNotMarked(Type type, String outputDirectory)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateType(Type type)
at TypeGen.Core.Generator.GenerateTypeDependencies(Type type, String outputDir)
at TypeGen.Core.Generator.GenerateClass(Type type, ExportTsClassAttribute classAttribute)
at TypeGen.Core.Generator.GenerateType(Type type)
at TypeGen.Core.Generator.Generate(Type type)
at TypeGen.Core.Generator.Generate(Assembly assembly)
at TypeGen.Cli.Program.<>c__DisplayClass10_0.<Generate>b__0(IEnumerable`1 acc, Assembly assembly)
at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)
at TypeGen.Cli.Program.Generate(String projectFolder, String configPath, Boolean verbose)
at TypeGen.Cli.Program.Main(String[] args)
Issue Analytics
- State:
- Created 7 years ago
- Comments:17 (9 by maintainers)
Top Results From Across the Web
Object reference not set to an instance of an object. on ...
Try it with Guid.TryParse or Guid.TryParseExact. If your example is correct, Your error is probably internal to the parsing, and your string ...
Read more >Object Reference Not Set to an Instance of an Object
This infamous and dreaded error message happens when you get a NullReferenceException. This exception is thrown when you try to access a member—for...
Read more >Get to the Bottom of C# Object Reference Not Set to an ...
So, this error description says that an object that is being called to get or set its value has no reference. This means...
Read more >Error: Object reference not set to an instance of an ...
Error: Object reference not set to an instance of an object. This error usually occurs when using a variable with no set value...
Read more >Still having big problems with Object reference not set to an ...
The error means that your code is trying to access/reference an object that is a null valued object that is not there in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s funny! I’m glad it’s sorted out now. As always, thank you very much for this great package!
I’m glad to hear that!
I think I know what was the problem with 1.5.4… I must have confused the chocolatey package with the nuget package when uploading to NuGet repository (both are nuget packages, but with different folder structure). Sorry for the confusion…
I wonder why it worked when I downloaded it from NuGet though, but that’s something I won’t be giving too much thought to. I’ll just try to be more careful next time 😃
Cheers!