Why does this call to aspnet_compiler not produce new .NET assemblies?

送分小仙女□ 提交于 2019-12-08 06:41:07

问题


I'm trying to make Visual Studio precompile my ASP.NET application that will be deployed on Azure. I've added the following to my .csproj file:

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

Now when I ask Visual Studio to prepare a service package the following appears in the build output:

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

If I plant an error in any of the view files that error is identified and breaks the build so clearly the precompilation is perfomed.

Yet I don't see any new .NET assemblies anywhere in the results.

How do I make ASP.NET compiler create the .NET assemblies for the views?


回答1:


If you don't specify an output directory you should find the output in this folder:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\some-random-id (try sorting on the date modified to find the latest directory).

When calling the aspnet_compiler.exe you can also append an output folder to the command:

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

Here you see the output in my C:\CompiledOutput folder



来源:https://stackoverflow.com/questions/12743021/why-does-this-call-to-aspnet-compiler-not-produce-new-net-assemblies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!