1

I am using Json.NET in my C# project and I am currently using "Embedded Resource" for Newtonsoft.Json.dll and my app became detected by some security apps so I can no longer use this way. I do not want to have Newtonsoft.Json.dll next to my EXE file, so I am wondering if there is any way to include Json.NET to my project without using DLL?

Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
  • You might try some of the solutions from [Can a .NET windows application be compressed into a single .exe?](https://stackoverflow.com/q/126611/3744182). Though see [System.OutOfMemoryException when merging Newtonsoft.Json](https://stackoverflow.com/q/53602936/3744182). – dbc Nov 18 '19 at 17:32
  • I haven't tried merging DLL with EXE with other apps, but if Embedded DLL from Visual Studio is detected I think it will be the same? – SilverSilencer Nov 18 '19 at 17:38
  • In [Can a .NET windows application be compressed into a single .exe?](https://stackoverflow.com/q/126611/3744182), assemblies are getting merged into a single assembly as if they had been compiled as a single project by Visual Studio, by directly combining their IL code. See e.g. https://github.com/dotnet/ILMerge. What you're doing is embedding an assembly in a resource file then loading it via reflection. That going to look quite different to an antivirus scan. But the only way to know for sure is to actually try. – dbc Nov 18 '19 at 17:44
  • 1
    I have now used ILMerge but new exe is than detected and automatically closed. I guess I will have to change code for serialize and use something else... – SilverSilencer Nov 18 '19 at 18:02
  • Why not download json.net source code and make it part of your solution? This is the *cleanest* way from an antivirus perspective. – Javier Silva Ortíz Nov 18 '19 at 21:46
  • What is it about Json.Net that is getting flagged by your security programs? – Brian Rogers Nov 18 '19 at 22:37
  • Using source and make it part of my app would probably solve this problem, but I dont know how to include it, was searching for some tutorial but can’t manage to do it. – SilverSilencer Nov 19 '19 at 21:32
  • I’m not sure what triggers security program, probably not Json.net but the fact that DLL is embedded. – SilverSilencer Nov 19 '19 at 21:34

0 Answers0