title: Do asp.net application variables pass by reference or value?
body: <p>I've discovered recently that when using the Session or Application objects within an ASP.net application, that it passes the values by reference.</p>
  
  <p>This works great most of the time, but now I'm in a place where I truly need a copy of the data, and not a reference to it, since I will discard any changes to it when done processing.</p>
  
  <p>I'm also aware of setting variables in the root of the application, effectively creating global application variables that have a bit better performance and eliminate all the casting craziness of the Session/Application objects.</p>
  
  <p>Does anybody know if the application variables pass by reference or value? I can't seem to dig up any data on the topic and would like to eliminate the code I currently have to "copy" the data from the Application object into a new variable for processing.</p>