指定的路径或文件名太长,或者两者都太长。完全限定文件名必须少于 260 个字符,并且目录名必须少于 248 个字符。
解决方案: 在发布的网站根目录中找到\Properties\PublishProfiles\项目名称.pubxml文件,在<PropertyGroup>节点内添加
<!--指定发布过程中临时文件的存放目录-->
<IntermediateOutputPath>..\Temp\</IntermediateOutputPath>
注意temp后边一定要加斜杠,不然会报另一个错误
The IntermediateOutputPath must end with a trailing slash.
因为IntermediateOutputPath这个目录,必须以斜杠结尾