title: how to resolve system.nullreference exception when calling web application from console application
body: <p>I have added dll reference of my web application inside console application.
  I am trying to call web application functions by creating object of web app inside console app.
  But the web application controls all are null, throwing null reference exception.</p>
  
  <p>Can anyone help resolving this issue?</p>
  
  <p>Here is my sample code
  I am using RadControls Web Application. there is one Radhtmlchart control.</p>
  
  <h2>webapp.aspx</h2>
  
  <pre><code>&lt;telerik:Radhtmlchart id=chart1 runat="server"/&gt;
  </code></pre>
  
  <h2>webapp.aspx.cs</h2>
  
  <p>I am binding control to datasource.</p>
  
  <pre><code>public void Loadchart()
  {
  chart1.datasource= getdata();
  chart1.databind
  }
  </code></pre>
  
  <h2>consoleapp</h2>
  
  <pre><code>using webapp;
  
  webapp obj= new webapp();
  obj.Loadchart();
  </code></pre>
  
  <p>while running the console app, I am getting error on Chart1.;object reference not set to instance of object.</p>