配置Visual Studio 2013以允许ASPNETCOMPILER使用x64编译器进行预编译

tac*_*cos 5 asp.net msbuild aspnet-compiler visual-studio-2013

如何在VS2013 x64项目中使用"发布期间预编译"标志?无论我做什么,它都无法发布,因为它坚持使用x86 ASPNETCOMPILER.

我想我曾经在VS2012中使用它,但升级到VS2013之后就不再有效了.

我记得修改涉及更改与之相关的文本文件,MSBuild但老实说我不太了解它,所以它有点朦胧.

任何帮助是极大的赞赏.谢谢!

Nit*_*wal 9

这似乎是Visual Studio 2013中的一个错误.

Microsoft Connect - 使用X64平台时预编译错误

其中列出的解决方法有效,是将Project/PropertyGroup xml标记中的以下xml添加到发布配置文件(位于项目的Properties\PublishProfiles目录中).

<AspnetCompilerPath>C:\Windows\Microsoft.NET\Framework64\v4.0.30319</AspnetCompilerPath>
Run Code Online (Sandbox Code Playgroud)

在应用上述解决方法之前,我遇到了这个构建错误:"无法加载文件或程序集'****'或其中一个依赖项.尝试加载格式不正确的程序." - ASPNETCOMPILER


Mic*_*age 5

Visual Studio 2015 Update 3 中仍然存在问题...

修复:在您喜欢的文本编辑器中打开项目的 csproj 文件。

定位:

<MvcBuildViews>true</MvcBuildViews>
Run Code Online (Sandbox Code Playgroud)

在它下面添加以下内容:

<AspNetToolPath Condition=" '$(Platform)' == 'x64'">$(windir)\Microsoft.NET\Framework64\v4.0.30319</AspNetToolPath>
Run Code Online (Sandbox Code Playgroud)

定位:

<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'" >
  <AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
</Target>
Run Code Online (Sandbox Code Playgroud)

修改 AspNetCompiler 行如下:

<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" ToolPath="$(AspNetToolPath)" />
Run Code Online (Sandbox Code Playgroud)