asp.net – 发布网站项目时Temp路径太长

我试图使用 Publish Web Site tool发布一个ASP.NET网站项目,但是得到这个错误

ASPNETCOMPILER(0,0): Error ASPRUNTIME: The specified path,file name,
or both are too long. The fully qualified file name must be less than
260 characters,and the directory name must be less than 248
characters.

我看到它正在尝试将文件复制到AppData中的很长的路径中:

copying all files to temporary location below for package/publish:

C:\Users\imx0\AppData\Local\Temp\1\WebSitePublish\BMW.Web-424993535\obj\Debug\AspnetCompileMerge\Source.

c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v /BMW.Web -p C:\Users\imx0\AppData\Local\Temp\1\WebSitePublish\BMW.Web-424993535\obj\Debug\AspnetCompileMerge\Source C:\Users\imx0\AppData\Local\Temp\1\WebSitePublish\BMW.Web-424993535\obj\Debug\AspnetCompileMerge\TempBuildDir

我的.pubxml发布配置文件中找不到关于此临时目录的任何内容。如何更改Visual Studio文件复制到的临时目录?

解决方法

将其添加到您的发布配置文件修改package / publish的临时目录:
<AspnetCompileMergeIntermediateOutputPath>c:\shortPath\</AspnetCompileMergeIntermediateOutputPath>

相关文章

### 创建一个gRPC服务项目(grpc服务端)和一个 webapi项目(...
一、SiganlR 使用的协议类型 1.websocket即时通讯协议 2.Ser...
.Net 6 WebApi 项目 在Linux系统上 打包成Docker镜像,发布为...
一、 PD简介PowerDesigner 是一个集所有现代建模技术于一身的...
一、存储过程 存储过程就像数据库中运行的方法(函数) 优点:...
一、Ueditor的下载 1、百度编辑器下载地址:http://ueditor....