发布网站项目时临时路径太长

9

本文介绍了发布网站项目时临时路径太长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在尝试使用 发布网站工具但出现此错误:

I am trying to publish an ASP.NET web site project using the Publish Web Site tool but get this error:

ASPNETCOMPILER(0,0): 错误 ASPRUNTIME: 指定的路径、文件名、或者两者都太长.完全限定的文件名必须小于260个字符,目录名必须小于248字符.

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 中很长的路径:

I see that it is trying to copy the files to a very long path in AppData:

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

C:Usersimx0AppDataLocalTemp1WebSitePublishBMW.Web-424993535objDebugAspnetCompileMergeSource.

c:WINDOWSMicrosoft.NETFrameworkv4.0.30319aspnet_compiler.exe -v /BMW.Web -p C:Usersimx0AppDataLocalTemp1WebSitePublishBMW.Web-424993535objDebugAspnetCompileMergeSource C:Usersimx0AppDataLocalTemp1WebSitePublishBMW.Web-424993535objDebugAspnetCompileMergeTempBuildDir

我在 .pubxml 发布配置文件中找不到有关此临时目录的任何信息.如何更改 Visual Studio 将文件复制到的临时目录?

I couldn't find anything about this temp directory in my .pubxml publish profile. How can I change the temporary directory that Visual Studio copies the files to?

推荐答案

将此添加到您的发布配置文件以修改包/发布的临时目录:

Add this to your publish profile to modify the temporary directory for package/publish:

<AspnetCompileMergeIntermediateOutputPath>c:shortPath</AspnetCompileMergeIntermediateOutputPath>

这篇关于发布网站项目时临时路径太长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

将运算符与其他参数一起传递
Passing an operator along with other parameters(将运算符与其他参数一起传递)...
2023-11-11 C#/.NET开发问题
6

Func&lt;string,string&gt; 有什么区别?和委托?
What is the difference between Funclt;string,stringgt; and delegate?(Funclt;string,stringgt; 有什么区别?和委托?)...
2023-11-11 C#/.NET开发问题
3

ASP.NET MVC 中的 &lt;%: 和 &lt;%= 有什么区别?
What is the difference between lt;%: and lt;%= in ASP.NET MVC?(ASP.NET MVC 中的 lt;%: 和 lt;%= 有什么区别?)...
2023-11-10 C#/.NET开发问题
0

标签系统的 linq 查询 - 搜索多个标签
linq query for tag system - search for multiple tags(标签系统的 linq 查询 - 搜索多个标签)...
2023-11-10 C#/.NET开发问题
0

论坛标签.实施它们的最佳方法是什么?
Forum tags. What is the best way to implement them?(论坛标签.实施它们的最佳方法是什么?)...
2023-11-10 C#/.NET开发问题
1

html 脚本标签未使用类型 javascript &lt;script type=&quot;text
html script tag not using type javascript lt;script type=quot;text/htmlquot;gt;?(html 脚本标签未使用类型 javascript lt;script type=quot;text/htmlgt;gt;?)...
2023-11-10 C#/.NET开发问题
6