Home | Documentation | Atomic Chat | Github

Issue with .shared


I have a problem with script context .shared in Visual Studio (2015 and 2017). I don’t have access to all C# libraries in .shared. (For example: XMLWriter.Create (string) from System.XML)
I tried to fix the problem, it helped for a time, but then all changed back after opening project in Atomic Editor.


The .Net project file generated for your project by the editor follows a standard template, and under certain conditions will get regenerated. If you want to add dependencies it doesn’t include, you need to either:

  1. ensure that the “AtomicNET” directory doesn’t get deleted (and that isn’t really practical IMO, especially since the build process is different between debug and release builds)
  2. have a separate solution that you add the generated projects to, and have your code in a separate C# project that references the generated AtomicNET dll. You can have that project build its output dll to your “Resources” directory. Then when you have the editor regenerate the .Net solution, it will include your dll as a reference automatically. Your project in turn can reference whatever dlls it needs, optionally copying them to the output directory. Be careful to NOT have the AtomicNET reference in your own library get copied to the output dir, you’ll have duplicate refs between that copy and the one in the AtomicNET durectory.

There’s an example of this structure in:


Oh, in the case of simpler third party dlls, you can always just drop them into the “resources” directory. The next time you have the editor regenerate your solution, it will include a reference to them. This is probably the simpler option, but I do find #2 above to be the most flexible (eg I can easily use nuget packages in my external project)