相关疑难解决方法(0)

由于文件路径太长,网站发布失败

我正在尝试从供应商发布一个网站项目,该供应商的某些文件路径非常漫长.发布时,错误是:

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.
Run Code Online (Sandbox Code Playgroud)

当我发布时,Visual Studio 2012 Update 3正在尝试写入临时目录,并且前缀很长:

 C:\Users\cuser\AppData\Local\Temp\WebSitePublish\MidasCMS400v9-1580334405\obj\Debug\Package\PackageTmp\
Run Code Online (Sandbox Code Playgroud)

我想我可以c:\tem通过遵循这个SO答案将VS重定向到另一个临时目录:发布网站项目时临时路径太长

我创建了我的发布配置文件,一旦打开它,就会出现一个错误,表明它WebPublishMethod不是一个元素PropertyGroup.无论如何,我更新了文件,看起来像这样:

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <publishUrl>C:\Sites\MidasPublish</publishUrl>
    <DeleteExistingFiles>False</DeleteExistingFiles>
    <AspnetCompileMergeIntermediateOutputPath>c:\tem\</AspnetCompileMergeIntermediateOutputPath>
  </PropertyGroup>
</Project>
Run Code Online (Sandbox Code Playgroud)

当我尝试发布时,我得到一个名为"检测到文件修改"的模式框弹出窗口,其中显示消息"项目YourWebsite已在环境外修改",并询问我是否要重新加载.在我的错误列表中,我继续得到关于路径太长的错误,因为它没有尝试使用c:\tem我识别的目录.

我需要将这个血腥的东西放到服务器上,我可以使用任何允许我发布血腥内容的解决方案.我对网站项目模板了解不多,所以如果有更好的方法,请告诉我.

asp.net msbuild visual-studio visual-studio-2012

29
推荐指数
2
解决办法
3万
查看次数

使用名称很长的文件发布项目

我试图在Visual Studio 2013中发布一个项目,其中包含一些名称很长的文件,包括路径位置.我将项目移动到更靠近我的根C:\驱动器的位置,这允许它进行编译,但在发布时,它会尝试将文件复制到%appdata%文件夹,这会导致名称超出限制.

这是我得到的错误:

Error   10  Copying file node_modules\grunt-bower\node_modules\bower\node_modules\bower-registry-client\node_modules\bower-config\node_modules\optimist\node_modules\minimist\.travis.yml to C:\Users\jake\AppData\Local\Temp\WebSitePublish\WebProject--1320288221\obj\Debug\Package\PackageTmp\node_modules\grunt-bower\node_modules\bower\node_modules\bower-registry-client\node_modules\bower-config\node_modules\optimist\node_modules\minimist\.travis.yml failed. 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.     0   0   WebProject
Run Code Online (Sandbox Code Playgroud)

有没有办法调整此项目的名称或临时复制到何处,以便我能够从Visual Studio发布?

.net asp.net visual-studio visual-studio-2013

6
推荐指数
1
解决办法
1243
查看次数