“Path too long” when publishing asp.net 5 from Visual Studio 2015

我怕爱的太早我们不能终老 提交于 2019-11-30 11:21:29

Change the temp output to a path with a shorter path name.

  1. Open your target .pubxml in .\Properties\PublishProfiles from a text editor.
  2. Change or add an element called PublishOutputPathNoTrailingSlash under PropertyGroup and set the value to your desired path.
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <PublishOutputPathNoTrailingSlash>C:\Temp\Publish</PublishOutputPathNoTrailingSlash>
  </PropertyGroup>
</Project>

For new asp.net mvc 6 in project.json use

"exclude": [ "wwwroot", "node_modules" ],`
"publishExclude": [ "**.user",  "**.vspscc" ]

I think this is what you're looking for:

When you go into the "Publish Web' dialog, you'll need to change the 'Target Location' within the "Connection" tab. (Hit the Square Box with ...) and then browse to C:\Temp and your files go there...

The dialog won't allow you to create C:\Temp on the fly, so if you haven't created it already , you'll need to do so beforehand.

I do hope this does it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!