NancyFx / Nancy.Serialization.JsonNet

NewtonSoft.Json serializer for Nancy
MIT License
40 stars 32 forks source link

Nancy not picking up my custom JsonSerializer #23

Closed cvetomir-todorov closed 9 years ago

cvetomir-todorov commented 9 years ago

I followed the readme.md instructions after creating my custom JsonSerializer in order to register it. But it wasn't picked up. I had to add the following lines to make it work:

container.Register<ISerializer, JsonNetSerializer>();
container.Register<IBodyDeserializer, JsonNetBodyDeserializer>();

Is the documentation incomplete/inaccurate or have I missed something? It clearly states that Nancy should detect JsonNetSerializer and JsonNetBodyDeserializer but it fails to do so.

cvetomir-todorov commented 9 years ago

I suppose that would be an issue of the compiler optimizations and lack of hard reference. Closing it.

khellang commented 9 years ago

Yeah. That's an unfortunate consequence of assembly scanning. We recently added the IncludeInNancyAssemblyScanning attribute to help with this.