是因为临时文件夹太长,自己设个临时文件夹:
在发布的网站根目录中找到*.publishproj文件,在<PropertyGroup>节点内添加<IntermediateOutputPath>..\Temp</IntermediateOutputPath>,将可以设置发布过程中的临时文件存放目录,这里设置的..\Temp将会在项目目录中自动创建一个Temp文件夹,
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion>10.0.30319</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{931b5de2-a433-45c0-a8f1-b320be80eebe}</ProjectGuid> <SourceWebPhysicalPath>$(MSBuildThisFileDirectory)</SourceWebPhysicalPath> <SourceWebVirtualPath>/WebSite</SourceWebVirtualPath> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <SourceWebProject>http://localhost:4354</SourceWebProject> <SourceWebMetabasePath>/IISExpress/7.5/LM/W3SVC/9/ROOT</SourceWebMetabasePath> <!--指定发布过程中临时文件的存放目录--> <IntermediateOutputPath>..\Temp</IntermediateOutputPath> </PropertyGroup>