I've recently upgraded a project to .NET Framework 4.6.1
and now am having issues when trying to deploy to Azure as a WebJob. I'm getting the following error:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\Web\Microsoft.Web.Publishing.targets(2603,5): Error : Copying file C:\Users\XXXXXXXXXXX\Documents\Source\Workspaces\XXXXX Server Application\ServerApplication\XXXXXXXX.IntegrationService\bin\Release\Microsoft.Extensions.DependencyInjection.Abstractions.dll to obj\Release\Package\PackageTmp\app_data\jobs\continuous\XXXXXXXXIntegrationService\Microsoft.Extensions.DependencyInjection.Abstractions.dll 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.
I'm confused by the error as the path and filename are only 189 characters combined:
C:\Users\XXXXXXXXXXX\Documents\Source\Workspaces\XXXXX Server Application\ServerApplication\XXXXXXXX.IntegrationService\bin\Release\Microsoft.Extensions.DependencyInjection.Abstractions.dll
If I remove the Microsoft.Extensions.DependencyInjection.Abstractions.dll from my project I can then deploy as normal. I've tried cleaning the solution and restarting VS.