为什么aspnet_compiler不编译.aspx文件?

时间:2015-08-19 17:54:03

标签: asp.net webforms aspnet-compiler

鉴于Windows Server 2012 R2(版本6.2(Build 9200)),IIS 8.5(.9600.16384)执行

  1. 创建一个指向新空文件夹的新网站
  2. 在网站文件夹中创建一个文件,其中包含以下内容:
  3. 
    
    <%@ Page language="c#"  %>
    <html>
    <body>
    <h3>
    <% Response.Write("Hello world!"); %>
    <% var neverUsed = 0; /*Just to emit warning*/%>
    </h3>
    </body>
    </html>
    &#13;
    &#13;
    &#13;

    1. 尝试使用以下命令行预编译网站:C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_compiler.exe -m /LM/W3SVC/5/Root -c
    2. 观察以下输出:

      Microsoft (R) ASP.NET Compilation Tool version 4.0.30319.33440 
      Utility to precompile an ASP.NET application
      Copyright (C) Microsoft Corporation. All rights reserved.
      
      c:\applications\test\default.aspx(6): warning CS0219: The variable 'neverUsed' is assigned but its value is never used
      
    3. 预期结果:正如所描述here default.aspx的内容应替换为&#34; 这是预编译工具生成的标记文件,不应该被删除!&#34;。

      实际结果:default.aspx内容相同。

      !注意!不使用-u开关。

0 个答案:

没有答案
相关问题