Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing all assemblies from <compilation><assemblies> in ASP.NET 4 web.config [duplicate]

Tags:

asp.net

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?

like image 759
Merritt Avatar asked Jan 21 '23 23:01

Merritt


1 Answers

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.

like image 68
Mitchel Sellers Avatar answered Jan 25 '23 14:01

Mitchel Sellers