本文介绍了编译>来自以下删除所有组件<&集会GT;在ASP.NET 4的web.config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  What在web.config中大会节点的目的是什么?

我删除了所有在编译/组件元素的添加元素。

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

所以最初在我的应用程序的根web.config文件:

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>

现在它看起来像:

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

和我的申请仍然有效。该项目文件仍然拥有所有我删除了引用,但本节似乎是在编译过程中未使用的(在Visual Studio中)。

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).

这是怎么回事?

推荐答案

在应用程序中本节的引用用于被动态完成的自动ASP.NET编译。如果要部署一个编译网站(无的.cs或.vb文件),那么你的罚款将其删除。

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.

这篇关于编译&GT;来自以下删除所有组件&LT;&集会GT;在ASP.NET 4的web.config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 18:36