简体   繁体   English

为什么我在我的web.config中得到了这个

[英]why I got this in my web.config

I got these dlls in gac then why I got them in web.config as well, 我在gac中得到了这些dll然后为什么我在web.config中得到它们,

<compilation debug="true">
  <assemblies>
    <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=removedForPrivacyMyself"/>
    <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=removedForPrivacyMyself"/>
    <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=removedForPrivacyMyself"/>
    <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=removedForPrivacyMyself"/>
  </assemblies>
</compilation>

My application seem to work fine when i remove this section 删除此部分时,我的应用程序似乎工作正常

These are just stored in the config file by default. 这些只是默认存储在配置文件中。 It also means that you do not need to provide a 这也意味着您不需要提供

using System.Web.Extensions;

etc. in every source file. 在每个源文件中。

During compilation, the compiler will use the <assemblies> section to figure out which assemblies to add into the compilation process. 在编译期间,编译器将使用<assemblies>部分来确定要添加到编译过程中的程序集。 If you do put usings everywhere then indeed this section adds nothing. 如果你确实在任何地方使用,那么这部分确实没有增加任何东西

Your web application project properly using those assemblies in the reference definition. 您的Web应用程序项目正确使用参考定义中的那些程序集。 You can remove them, but remember if you going to use one of those assemblies your web application won't work. 您可以删除它们,但请记住,如果您要使用其中一个程序集,您的Web应用程序将无法运行。

Usually the visual studio add them automatically your web.config 通常,visual studio会自动添加web.config

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我的 web.config 在我发布时被覆盖? - Why is my web.config being overwritten when I publish? 为什么使用WebConfigurationManager在Web.Config中找不到AppSetting? - Why can I not find an AppSetting in my Web.Config with WebConfigurationManager? 为什么我不能在我的 Web ASP 应用程序中打开自定义 web.config 文件? - Why can't I open a custom web.config file in my web ASP app? 为什么我的 404 重定向在我的 web.config 中不起作用? - Why does my 404 redirect not work in my web.config? 为什么我无法运行MVC5应用,web.config文件出现错误? - Why i cannot run my MVC5 app, error from web.config file? 我唯一的连接字符串是LocalSqlServer-运行测试时为什么不加载Web.config? - My only connection string is LocalSqlServer - Why is Web.config not loading when I run a test? 使用自定义部分时,为什么必须在我的app.config中指定程序集而不是为web.config指定程序集 - Why do I have to specify the assembly in my app.config but not for my web.config when using custom sections 如果我在我的web.config文件中进行更改,则DLL是否更改 - Dll changes or not if i do change in my web.config file 为什么必须修改web.config才能启用调试? - Why do I have to modify the web.config to enable debugging? 我正在尝试在 web.config 端点中使用本地服务(.svc),但在 SettingServiceCLient.cs 函数中出现错误 - I am trying to use local service(.svc) in web.config endpoints but I got an error in SettingServiceCLient.cs functions
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM