title: Accessing objects from a c# console app externally
body: <p>I'm a new junior dev and working on my first solo project. For that im creating a c# console app for automated word document creation. The plan is to integrate the app in different projects and different invironments thats why it should be an stand alone solution. But in order to give it a little more felxability and versatility I want the app to give some output.</p>
  <p>Because of the different invironments the app should be useable with e.g. a python script aswell. What would be the best practice to do so??? especially if you want to give diffrent outputs depending on the use case???</p>
  <p>A litte example:
  I'm getting an json object with all the information to create a word document. In the stand alone solution I don't need an output (it only creats a word doc and pfd). But if I want to use the app it in an wpf UI project were i want preview and live update functionality it would be nice to have access to the created objects.
  In order to achieve this would I work with a <strong>return value</strong> (exit code) and (depending on the code) create the desired objects again, or would I embed it as a <strong>library</strong> and just call all the normal functionality, or could i even do something like an <strong>out value</strong> or <strong>complex return value</strong> (like string[]) to return a serialized object?</p>
  <p>a.)</p>
  <pre><code>static int Main(string[] args)
  {
     //do something
     return *code for decision making*
  }
  </code></pre>
  <p>b.) create library</p>
  <p>c.)</p>
  <pre><code>static void Main(string[] args, out string[] output)
  {
     //do something
     output = *serialized object(s)*
  }
  </code></pre>
  <p>or</p>
  <pre><code>static string[] Main(string[] args)
  {
     //do something
     return *serialized object(s)*
  }
  </code></pre>