Visual Studio 2013 calls 32 bit aspnet_compiler instead of 64 bit one

自古美人都是妖i 提交于 2019-12-04 02:48:19

Add this line to the .csproj file within a PropertyGroup node for the build configuration you are targeting (or use the ProperyGroup that doesn't have a target to target all release modes).

<AspnetCompilerPath>$(windir)\Microsoft.NET\Framework64\v4.0.30319</AspnetCompilerPath>

The 64-bit version is then used by the compiler. For me, the node I added this line to was as below:

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
   <AspnetCompilerPath>$(windir)\Microsoft.NET\Framework64\v4.0.30319</AspnetCompilerPath>
</PropertyGroup>

I have exactly the same problem.

You can create BAT-files to replace the EXE before you start your publish. or Or you could write a BAT that calls the aspnet_compiler.exe directly and does the publish without the UI :-)

Add this line to the .pubxml file (Tree Solution\Project\Properties\PublishProfiles\.pubxml) within a PropertyGroup node for the publish configuration. For example:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <AspnetCompilerPath>$(windir)\Microsoft.NET\Framework64\v4.0.30319</AspnetCompilerPath>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <publishUrl>C:\Pub\FTS_Service</publishUrl>
    <DeleteExistingFiles>True</DeleteExistingFiles>
    <PrecompileBeforePublish>True</PrecompileBeforePublish>
    <EnableUpdateable>True</EnableUpdateable>
    <DebugSymbols>False</DebugSymbols>
    <WDPMergeOption>DonotMerge</WDPMergeOption>
  </PropertyGroup>
</Project>

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