question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

System.Guid & GENERIC ERROR: Object reference not set to an instance of an object.

See original GitHub issue

After 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:closed
  • Created 7 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
daveriedstracommented, Mar 23, 2017

That’s funny! I’m glad it’s sorted out now. As always, thank you very much for this great package!

0reactions
jburzynskicommented, Mar 23, 2017

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found