asp.net - 为什么对 aspnet_compiler 的调用不会生成新的 .NET 程序集?

标签 asp.net visual-studio-2010 azure azure-web-roles aspnet-compiler

我正在尝试让 Visual Studio 预编译将部署在 Azure 上的 ASP.NET 应用程序。我已将以下内容添加到我的 .csproj 文件中:

<Target Name="AfterBuild">
    <Message Text="Starting AspNetCompiler for $(ProjectDir)" Importance="high" />
    <AspNetCompiler
        VirtualPath="/"
        PhysicalPath="$(ProjectDir)"
    />
</Target>

现在,当我要求 Visual Studio 准备服务包时,构建输出中将显示以下内容:

Starting AspNetCompiler for [PathToMyProject]
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v / -p [PathToMyProject]

如果我在任何 View 文件中植入错误,该错误就会被识别出来,并会明显地破坏构建,从而执行预编译。

但是我在结果中没有看到任何新的 .NET 程序集。

如何让 ASP.NET 编译器为 View 创建 .NET 程序集?

最佳答案

如果您没有指定输出目录,您应该在此文件夹中找到输出:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\some-random-id(尝试按修改日期排序以查找最新目录)。

调用aspnet_compiler.exe时,您还可以将输出文件夹附加到命令中:

aspnet_compiler -v "/" -p "C:\Projects\WebApplication1\WebApplication1" C:\CompileOutput

在这里您可以看到我的 C:\CompiledOutput 文件夹中的输出

enter image description here

关于asp.net - 为什么对 aspnet_compiler 的调用不会生成新的 .NET 程序集?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12743021/

相关文章:

c# - 查找网络性能问题的根源

c# - 写出 zip 文件在 IE7 中不起作用

asp.net - 用于开发新的Windows Azure管理门户的框架?

c# - 如何比较两个base64字符串?

visual-studio-2010 - Visual Studio 2010 C++ : How to tell which LIB files the linker actually tries to link?

visual-studio-2010 - 如何在非用户特定位置安装 Visual Studio 项目模板?

c++ - 为什么编译器无法在我的代码中推断出模板参数?

将消息放入服务总线中的队列后不会触发 Azure Function

git - 如何使用 Git (Bitbucket) 在 Azure 上提供静态站点?

java - Cosmosdb 保存的数据无法在门户中找到,而是从 azure-documentdb-spring-boot-starter 中找到