5

Possible Duplicate:
What is the purpose of the Assemblies node in Web.Config?

I removed all the 'add' elements in the compilation/assemblies element.

So initially in my application's root web.config file:

<compilation debug="true" targetFramework="4.0">
  <assemblies>
    <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Web.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  </assemblies>
</compilation>

Now it looks like:

<compilation debug="true" targetFramework="4.0">
  <assemblies>
  </assemblies>
</compilation>

And my application still works. The project file still has all the references I removed, but this section appears to be unused during compilation (inside visual studio).

What is going on?

Community
  • 1
  • 1
Merritt
  • 2,333
  • 21
  • 23

1 Answers1

9

The references in this section of the application are used for the automatic ASP.NET compilation that is done on the fly. If you are deploying a compiled site, (no .cs or .vb files) then you are fine to remove it.

Luke Puplett
  • 42,091
  • 47
  • 181
  • 266
Mitchel Sellers
  • 62,228
  • 14
  • 110
  • 173
  • 1
    Similar Question - http://stackoverflow.com/questions/530683/what-is-the-purpose-of-the-assemblies-node-in-web-config – Mitchel Sellers Jun 03 '10 at 15:25
  • yeah this question is a duplicate. – Merritt Jun 03 '10 at 18:58
  • @MitchelSellers, please explain the term "compiled site". I don't understand whether you are referring to assembly generated for the website / web application project. – Kira Nov 07 '16 at 13:28