aspnet_compiler 忽略目标目录并将 dll 保留在临时 ASP.NET 文件目录中

aspnet_compiler ignores target directory and leaves dlls in the Temporary ASP.NET Files directory

我在预编译 ASP.NET MVC 应用程序时遇到问题。这是我项目的 csproj 文件中的 <AspNetCompiler> 任务:

<AspNetCompiler Clean="true"
                FixedNames="true"
                Updateable="false"
                VirtualPath="/"
                PhysicalPath="$(ProjectDir)"
                TargetPath="$(ProjectDir)..\PreCompiledOutput" />

一切除了预编译的dll最终都在目标路径中。预编译的 dll 本身是在临时 ASP.NET 文件目录中创建的。

这是一个问题,因为此项目构建中的下一个 MSBuild 任务是 运行 aspnet_merge 预编译的 dll。因为它们不在目标路径中 aspnet_merge 抱怨 "cannot find any assemblies that can be merged in the application bin folder".


FWIW 我已经尝试创建一个新的 ASP.NET MVC 应用程序并在该项目中使用上述 <AspNetCompiler> 任务,我得到了相同的行为,即除了预编译的 dll 之外的所有内容最终都在目标路径。因此,它似乎不是导致问题的任何特定项目。但是,如果我删除 <AspNetCompiler> 任务,而是设置一个配置为预编译应用程序的发布配置文件,预编译的 dll do 最终会出现在目标路径中。


有人以前见过这样的东西吗? <AspNetCompiler> 任务中有什么我遗漏的吗?

嗯,原来这是 McAfee anti-virus

造成的

我禁用了按访问病毒扫描,运行 aspnet_compiler,一切正常。