title: How to precompile ASP.NET 4.0 to a Single DLL with VS 2010
body: <p>I recently upgraded from VS 2003 where I was working on a ASP.NET 2.0 website to VS 2010 where I have migrated to ASP.NET 4.0.  So far it has been a big headache to get my site compiling with the new version.  One problem was that my aspx.cs pages could not find the shared code libraries in my project.  I solved this by moving my shared code to the App_Code folder (if there's a different/better way to do it please let me know).  </p>
  
  <p>Another issue that I am finding confusing is with pre-compilation.  With VS 2003 I could click the build project button and it would precompile my site into a myweb.dll and myweb.pdb files.  Now I'm having trouble doing the same in VS 2010.  When I build the site in VS 2010 the dll is not created.  I did manage to find an option to "Publish" the site which takes forever (like 2 minutes) and involves duplicating the site to another folder.  This would have been acceptable but instead of making the single DLL file, it makes a bunch of files: App_code.compiled, app_code.dll, App_code.pdb, App_global.asax.compiled, App_global.asax.dll, App_global.asax.pdb, App_Web_lrpcway1.dll, App_Web_lrpcway1.compiled, App_Web_lrpcway1.pdb.</p>
  
  <p>The application works - I can deploy it with all these files.  However, I'd really like someone to explain what are the extra files and if there is a better way how to do it.</p>
  
  <p>Thanks</p>