title: How to use Resources.resw in Class library project in UWP?
body: <p>I am currently working on Windows 10 UWP. At first, I only had one project to which I added a Constants.resw file to use resources which I saved in local storage and accessed them later. Now I have created a Background Task of type <em>Timer</em> and I want to access my database in Timer Background Task project so I created a Class Library Project and added all the POJOS and Utils classes in that project. Can someone suggest whether I can add a Constants.resw in class library project and how?</p>
  
  <p>Also, I want to access it using below code which I used when I had a single project(Windows 10 UWP Project)</p>
  
  <pre><code>ApplicationDataContainer userSettings = ApplicationData.Current.LocalSettings;
  if (!userSettings.Containers.ContainsKey(Constants.DB_AVAILABLE)) //if (!checkIfDBExists().Result)
  {
       //some operations
  }
  </code></pre>
  
  <p>When, I try to use Constants.resw in my background tasks, I get following error</p>
  
  <pre><code>Exception thrown: 'System.TypeInitializationException' in Common.dll
  System.TypeInitializationException: The type initializer for 'Common.CommonResources.Constants' threw an exception. ---&gt; System.Exception: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
  at Windows.UI.Xaml.Application.get_Current()
  at Common.CommonResources.Constants..cctor()
  --- End of inner exception stack trace ---
  at Common.CommonResources.Constants.get_DB_AVAILABLE()
  at Common.DatabaseManager.getSQLiteConnection()
  at Common.DatabaseManager.getLocationDetails()The type initializer for 'Common.CommonResources.Constants' threw an exception.
  </code></pre>