Closed etcvee closed 2 months ago
Can you test this project out on your machine?
I have generated the code with v3.0.2. I do not see this issue.
I can reproduce this issue. It appears to be trying to load the net8.0 version of Corvus.Json.ExtendedTypes
despite the transient dependency on the netstandard2.0
version.
The exception would also disappear if your exe was targetting a vesion of dotnet prior to net8.0
One way to fix this would be to multitarget your netstandard2.0 library.
Replace
<TargetFramework>netstandard2.0</TargetFramework>
with
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
I've added <TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
and it works correctly.
Also I've created a netcoreapp3.1
project and with the same target frameworks it also works correctly.
Many thanks!
That's fantastic. I will add documentation to the README to cover off this case and to address #340 at the same time.
Fixed in #393 - please try the Preview packages on nuget, and examine the updated README.md
Hi,
There is an issue when trying to use generated by the
generatejsonschematypes
code from .NET Standard 2.0 class library in .NET 8.0 project:The exception dissapears when switching the class library to
net8.0
in csproj.Tool version is:
Repro steps:
Create a json schema
Generate C# classes from the json schema (I used
GeneratedClasses
for namespace)Put generated classes into class library and targets
netstandard 2.0
System.TypeLoadException
will be thrown