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
System.TypeInitializationException: The type initializer for 'NetJSONCachedSerializer`1' threw an exception. ---> System.TypeLoadException: Access is denied: 'NetJSON.NetJSONSerializer`1[System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.Dictionary`2[System.String,System.String]]]'. at System.Reflection.Emit.TypeBuilder.CreateTypeNoLock() at System.Reflection.Emit.TypeBuilder.CreateType() at NetJSON.NetJSON.Generate(Type objType) at NetJSON.NetJSON.NetJSONCachedSerializer`1.GetSerializer() at NetJSON.NetJSON.NetJSONCachedSerializer`1..cctor() --- End of inner exception stack trace --- at NetJSON.NetJSON.GetSerializer[T]() at NetJSON.NetJSON.Deserialize[T](String json) at
Activity
hhblaze commentedon Nov 19, 2020
NetJSON.zip
Probably it can look like that (added preprocessor directives NET5_0) and created NetJSON.Net5_0 project.
VS19 16.8.1 is needed for .NET 5
rpgmaker commentedon Nov 19, 2020
Thanks. Will make the changes
hhblaze commentedon Nov 19, 2020
Made a small fix (after that my code runs good). All places must be rechecked like
#if NET_STANDARD_20 || NET5_0
#if NET_STANDARD
#if NET_STANDARD_20 || NET5_0
etc.
NetJSON.zip
rpgmaker commentedon Nov 19, 2020
Thanks for the help. Will take a look at it once I get a chance
rpgmaker commentedon Nov 24, 2020
Please test again. I also went ahead and added the symbol for easy debugging of the nuget packages. Thanks again for contributing the changes.
hhblaze commentedon Nov 24, 2020
This adventure is not finished yet:
1.3.6 throws mistake (with my compilation it works) by reading such json string:
rpgmaker commentedon Nov 24, 2020
I guess I need some unit test specifically for .net 5.0
rpgmaker commentedon Nov 24, 2020
Your compilation works where?
hhblaze commentedon Nov 24, 2020
I would say that it works exactly like .NET standard... but preprocessor directives "#if NET_STANDARD_20 || NET5_0" sometimes tricky.
hhblaze commentedon Nov 24, 2020
From the latest NetJson.zip I published here, I have changed mostly those twofiles for adding NET5_0 directive:
rpgmaker commentedon Nov 24, 2020
I added the constant and applied it for any net standard 2.0 code since they are similar
rpgmaker commentedon Nov 24, 2020
Can you create a pull request instead based on the previous code before my change and I can see what I missed.
Thanks
hhblaze commentedon Nov 24, 2020
Yeap, you got a pull request
rpgmaker commentedon Nov 24, 2020
Thanks. Will close this issue out and use the pull request for questions
rpgmaker commentedon Nov 24, 2020
@hhblaze, Thanks i have updated the code and pushed another version.