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
First of all, what an exciting library! I'm eager to apply it to my project.
I've been unable to overcome the following exception with a bare-minimum usage of the programmatical API and .NET 7.
Could not load file or assembly 'Namotion.Reflection, Version=2.1.1.0, Culture=neutral, PublicKeyToken=c2f9c3bdfae56102'. The system cannot find the file specified.
at TypeGen.Core.Extensions.TypeExtensions.IsNullable(MemberInfo memberInfo)
at TypeGen.Core.Generator.Services.TypeService.GetTypeUnions(MemberInfo memberInfo)
at TypeGen.Core.Generator.Generator.GetInterfacePropertyText(Type type, MemberInfo memberInfo)
at TypeGen.Core.Generator.Generator.<>c__DisplayClass51_0.b__0(String current, MemberInfo memberInfo)
at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable1 source, TAccumulate seed, Func3 func)
at TypeGen.Core.Generator.Generator.GetInterfacePropertiesText(Type type)
at TypeGen.Core.Generator.Generator.GenerateInterface(Type type, ExportTsInterfaceAttribute interfaceAttribute)
at TypeGen.Core.Generator.Generator.GenerateType(Type type)
at TypeGen.Core.Generator.Generator.<>c__DisplayClass33_0.b__0()
at TypeGen.Core.Generator.Generator.ExecuteWithTypeContextLogging(Action action)
at TypeGen.Core.Generator.Generator.GenerateMarkedType(Type type)
at TypeGen.Core.Generator.Generator.Generate(IEnumerable`1 generationSpecs)
at TypeScriptGeneratorSample.Program.Main(String[] args) in C:\Users\jonashw\GitRepos\TypeScriptGeneratorSample\Program.cs:line 12
using TypeGen.Core.Generator;
using TypeGen.Core.SpecGeneration;
namespace TypeScriptGeneratorSample
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
var gen = new Generator();
gen.Generate(new[] { new SampleGenerationSpec() });
}
}
public class SampleGenerationSpec : GenerationSpec
{
public override void OnBeforeGeneration(OnBeforeGenerationArgs args)
{
AddInterface(typeof(SampleRecord));
}
}
public record SampleRecord(int Id, string Name, DateTime Created, bool Active);
}
Curiously, I've been able to make SampleGenerationSpec work via dotnet-typegen generate without an issue.
generated/sample-record.ts:
/**
* This is a TypeGen auto-generated file.
* Any changes made to this file can be lost when this file is regenerated.
*/
export interface SampleRecord {
id: number;
name: string;
created: Date;
active: boolean;
}
Am I doing something wrong or have I discovered a bug?
The text was updated successfully, but these errors were encountered:
I'm encountering the same issue with .NET 6.0 and TypeGen 5.0.1. The only solution I've found is to manually add a package reference to Namotion.Reflection: <PackageReference Include="Namotion.Reflection" Version="2.1.1" />
Would it be possible to include Namotion.Reflection as a dependency in the TypeGen NuGet package to streamline the setup process and prevent this issue?
First of all, what an exciting library! I'm eager to apply it to my project.
I've been unable to overcome the following exception with a bare-minimum usage of the programmatical API and .NET 7.
tgconfig.json:
C# source:
Curiously, I've been able to make
SampleGenerationSpec
work viadotnet-typegen generate
without an issue.generated/sample-record.ts:
Am I doing something wrong or have I discovered a bug?
The text was updated successfully, but these errors were encountered: