asp.net – compilation debug =“true”和发布模式“release”之间是否有任何关系
发布时间:2020-05-22 12:28:01 所属栏目:asp.Net 来源:互联网
导读:我需要设置debug =’false’吗? compilation debug=false targetFramework=4.0 / 即使在发布模式下发布我的代码. 编辑1 正如MSDN编译概述中所述,它是在两个阶段完成的 在第一阶段,它将代码编译为一个或多个程序集 在第二个pahse中,将MSIL转换为运行应用程序
|
我需要设置debug =’false’吗? <compilation debug="false" targetFramework="4.0" /> 即使在发布模式下发布我的代码. 编辑1 正如MSDN编译概述中所述,它是在两个阶段完成的 >在第一阶段,它将代码编译为一个或多个程序集 发布代码是指第1阶段和 解决方法我不完全理解你的问题.如果您询问手动需要设置debug =’false’,那么如果项目中存在包含配置转换的文件,则答案将取决于事实.当前的Visual Studio标准Web项目模板包含两个带有配置转换的文件:Web.Debug.config和Web.Release.config.这些文件包含在发布代码期间应用的配置转换.这是默认Web.Release.config文件的示例:<?xml version="1.0"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below,the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an atrribute "name" that has a value of "MyDB".
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<!--
In the example below,the "Replace" transform will replace the entire
<customErrors> section of your web.config file.
Note that because there is only one customErrors section under the
<system.web> node,there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>
因此,如果您有Web.Release.config转换文件,其内容与上述类似,并且您使用Visual Studio的发布功能(或根据msbuild目标),那么当您在发布中发布项目时,将删除debug =’true’属性模式. 从web配置中删除debug =’true’有很多好处.此设置不仅会影响已编译的dll,还会影响将加载的MS Ajax脚本版本(如果使用ASP.NET Web窗体和脚本管理器控件). MS Ajax库的调试版本有很多检查(参数验证等),这些检查从脚本的发行版本中删除.这就是调试版本运行缓慢的原因. (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-mvc – MVC Preview 5 – 将视图呈现为字符串以进行
- asp.net-mvc – EntityFramework.SqlServer未在Web发布中部
- asp.net – 每个会话的NH请求 – “会话已关闭
- asp.net – 查找和删除孤立的网页,图像和其他相关文件
- asp.net – 单元测试Web服务 – HttpContext
- asp.net-mvc-3 – ASP.NET MVC3 WebGrid – 自定义,服务器端
- asp.net – 为什么即使我将EnableViewState设置为false,也会
- ASP.NET Web站点项目中的“复制本地”等效参考
- asp.net – VB.NET接口
- 如何做一个ASP.NET MVC Ajax表单与multipart/form-data?
推荐文章
站长推荐
- asp.net – 向实体框架添加其他属性4代码首先是C
- asp.net-web-api – AttributeRouting不能与Http
- asp.net-mvc – 为什么ASP.NET MVC在从IE而不是f
- asp.net – IIS如何知道它是服务于一个网站还是一
- asp.net-mvc-3 – ASP.Net MVC 3:在哪里处理会话
- asp.net-mvc-3 – ASP.NET MVC 3: – 使用数据库
- ASP.NET MVC模型绑定IList 参数
- asp.net核心 – ASP.NET核心中的基本身份验证
- asp.net-mvc – ASP.NET MVC使用自定义角色提供程
- asp.net核心 – 无法在IISExpress中启动ASP.NET
热点阅读
