title: net core 2.0 read file added as resources
body: <p>I am doing a C# Net Core 2.0 Application... </p>
  
  <p>I have a <code>.sln</code> with several Console projects called PrjA, PrjB, PrjC that will be run in differents ports, port 5000, port 5010, port 5020. They are running in parallel by Console </p>
  
  <pre><code>C:&gt;dotnet PrjA.dll
  C:&gt;dotnet PrjB.dll
  C:&gt;dotnet PrjC.dll
  </code></pre>
  
  <p>I have another Library Project called <code>PrjCommon</code> that it is referenced by all three Project. In this Project I want to have a configuration file in common to all three projects.</p>
  
  <p>this file is a <code>json</code> file called <code>portsettings.json</code>.</p>
  
  <p>When i run any of those projects in <code>Debug</code> mode or generating the <code>Publish folder</code>, <code>portsettings.json</code> file is not saved. </p>
  
  <p>In <code>PrjCommon</code> Project I tried to embebed <code>portsettings.json</code> as a file in <code>Resources.resx</code>.</p>
  
  <p>From any of these three projects, I called a Method in PrjCommon that should read <code>portsettings.json</code> file.</p>
  
  <p>I have tried to read this file from Resources.resx in two ways.</p>
  
  <p>First like this</p>
  
  <pre><code>var assembly = Assembly.GetEntryAssembly();
   string[] names = assembly.GetManifestResourceNames();
  </code></pre>
  
  <p>but <code>names</code> is null.</p>
  
  <p>And Second</p>
  
  <pre><code>var byteArray = Resources.portsettings;
  </code></pre>
  
  <p>That return a bytes arrays, but i can not transform those byte array into json.</p>
  
  <p>My questions is how can I make it Works. Either to save json file when I Compile those Projects, or, to save it as resources file and be able to read it.</p>
  
  <p>Thanks</p>