Open mohsenrezaeis opened 3 years ago
@mohsenrezaeis thanks for contacting us.
@vijayrkn is this the web tools?
Depends. Is this a .net core web job or a full framework web job? Can you please share the csproj?
it's a .Net Core project. Here is the project file.
<Project Sdk="Microsoft.NET.Sdk;Microsoft.NET.Sdk.Publish">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UserSecretsId>essdev</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<Content Include="..\..\CoreService\TNG.Services.CoreService.Contract.Web\appsettings.json" Link="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.2.3" />
<PackageReference Include="Microsoft.Azure.ServiceBus" Version="5.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="3.1.0" />
<PackageReference Include="Topshelf.autofac" Version="4.0.1" />
<PackageReference Include="Topshelf.Nlog" Version="4.2.1" />
<PackageReference Include="Mongodb.driver" Version="2.10.4" />
<PackageReference Include="Mongodb.messaging" Version="2.0.0.28" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.6" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="3.1.6" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.1.6" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.6" />
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.6" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.1.6" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\TNG.Core\TNG.Core.MongoQueue\TNG.Core.MongoQueue.csproj" />
<ProjectReference Include="..\..\..\TNG.Core\TNG.Core\TNG.Core.csproj" />
<ProjectReference Include="..\TNG.Services.Activation.Core\TNG.Services.Activation.Core.csproj" />
<ProjectReference Include="..\TNG.Services.Activation.Domain\TNG.Services.Activation.Domain.csproj" />
<ProjectReference Include="..\TNG.Services.Activation.Logic\TNG.Services.Activation.Logic.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="Settings.job">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
Ping @vijayrkn ?
This belongs to the dotnet/sdk repo. Can you please move there?
Same issue here, net core 3.1 and vs 2019. Any workaround?
We are experiencing the same issue on multiple machines. When we clone our solution to an external drive we see this error, when we clone it to our "C:" (the drive with Windows/Visual Studio) installed we do not see the error. Seems as though we can copy the solution folder from C to any other drive as well and that also works.
Cloning the same exact repo/solution to external drive produces the "could not copy" while cloning to C: (Windows/VS) does not.
I juts hit the same issue publishing a Asp.Net Core 3.1 web job from VS. It appears it is related to the length of the target path when copying file to the TempPub folder. It seems that when the path exceeds 256 characters it will cause the publish error. I was able to resolve the issue by simply shortening the name of assemblies and/or the web job name.
@JiriRichter That did the trick! Thanks for letting us know.
Any plans to fix this? Shortening names isn't always as easy as it should be.
A good chunk of the path is outside of my control: obj\Debug\net471\win7-x86\PubTmp\Out\app_data\Jobs\Continuous
Seems like there should be a checkbox to do deployments via the user's temp directory rather that using these massively nested folders.
I was able to work around the problem by creating a file share and mapping it as a drive, and opening that mapped drive whenever working on my webjob project. But it would be nice if someone could prioritize and fix this issue. I also considered playing with the LongPathsEnabled registry key on Windows 10 but that doesn't seem like a sure thing either.
What is the update of this issue? It's been 9 months...
There is an PublishIntermediateTempPath
property. Can you try setting that. It's only used for web and things like Azure web jobs (which it sounds like you are using)? The property is public and supports being overridden
I've been blocked by this for six months, it's complaining about bootstrap files and i think it's because of a character limit. There's nothing I can do to shorten the path lower than 256 characters.
This has been blocking my work for over a year at this point. If you're reading this, be warned! Do anything you possibly can to avoid working with .NET
@kylemcnee I had the same issue but fixed it thanks to @joeloff comment.
You can add these 2 lines to your publish profile to use different (shorter) paths during the publish:
<PublishIntermediateTempPath>D:\Temp\VS2019\MyWebJob\Tmp\</PublishIntermediateTempPath>
<PublishIntermediateOutputPath>D:\Temp\VS2019\MyWebJob\Out\</PublishIntermediateOutputPath>
Hope this helps.
The PublishIntermediateTempPath
workaround works well, but ran into a problem where this excludes the Settings.job file on publish. When the project folder is truncated to not need PublishIntermediateTempPath
the Settings.job file is included in the publish output.
I went into the publish profile ({project folder}\Properties\PublishProfiles\ClickOnceProfile.pubxml), and changed the following 2 entries as follows:
<PublishUrl>publish\Release</PublishUrl>
Then the project publishes to: publish\Release
Describe the bug
i'm trying to publish a webjob to Azure but I get some errors like the following. looks like it's because in the path after 'Out' it adds two backslashes instead of one (PubTmp\Out\\app_data).
Further technical details
I'm using ASP.Net Core 3.1 and visual studio 2019