I have tried deleting bin and obj directories an the publishing profile.
Some how the artifacts are being put int PubTmpOut and VS is trying to publish them from PubTmpOutbin
I have the same problem.
The environment creates a path without / bin
and then trying to write to the path with / bin
Same problem here... in my case it's looking for ...\ net461 \PubTmp\Out\bin which is clearly not created, when I look in the Out folder during publish. 馃
As a temporary work-around I have manually ZIPped my project and deployed it to Azure via Kudu:
https://APPSERVICENAME.scm.azurewebsites.net/ZipDeployUI
same problem here. bin folder was not created during publish.
Same problem here
same problem. Weirdly enough it worked a couple of times and then started to fail after i made a change to my code and wanted to publish it again.
While trying to Package the solution I found a Setting in the File:
"MyUserDirectory".nugetpackagesmicrosoft.azure.webjobs.script.extensionsmetadatagenerator1.0.1buildMicrosoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets
<Target Name="_GenerateFunctionsExtensionsMetadataPostPublish"
AfterTargets="Publish">
<GenerateFunctionsExtensionsMetadata
SourcePath="$(PublishDir)bin"
OutputPath="$(PublishDir)bin"/>
</Target>
I changed it to:
<Target Name="_GenerateFunctionsExtensionsMetadataPostPublish"
AfterTargets="Publish">
<GenerateFunctionsExtensionsMetadata
SourcePath="$(PublishDir)"
OutputPath="$(PublishDir)"/>
</Target>
And now I can Publish again
Moving to SDK for triage
/cc @soninaren
Its worked. I was using version Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator (1.0.1) and after editing the target file and removing bin it worked. May be have to update azure SDK.
Thanks to @RAAAAN
@RAAAAN - you're a gentleman, and a scholar. I salute you - the resolution in your comment solved the issue for me as well. Thanks!
Moving this to sprint 63 for additional investigation/follow up.
This resolved my issue as well. I'm on version 1.1.2 of microsoft.azure.webjobs.script.extensionsmetadatagenerator. So, I modified the same file in that package and it resolved the issue.
This hit me too today! Of course, when I had to make a quick deployment! :/
I have not been able to reproduce this. @bobbytreed can you share your csroj file.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.
I have this with the following .csproj file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AzureFunctionsVersion>v2</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.EventGrid" Version="3.2.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="3.0.2" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.24" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
</Project>
The workaround posted by @RAAAAN works.
wow, @RAAAAN posting worked for me also. I am using 1.0.1 for some reason
But how do you change the target file when you do a build and publish from a build pipeline in Azure DevOps? Can you edit the nuget packages on the build server?
The packages that were referencing Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator were using 1.1.1. This was causing the publish bug locally, which I fixed by changing the targets file. After which builds were working locally. But the error came back in a build in a build pipeline on our DevOps environment.
Another solution I've read about to fix these publish errors, would be to add a separate reference to the package Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator. I've tried this with a new version (1.1.3) locally. But with this version the error came back (because the version has its own target file in the nuget package folder in you user directory). Changing the target file again is in our case not an option, because the error will return surely in our DevOps build pipeline build.
While trying to Package the solution I found a Setting in the File:
"MyUserDirectory".nuget...
Just a warning to anyone else reading this, after I completed RAAAAN's work around (and i could publish), when on a new project, publishing .net 3.1 azure functions in a separate app, local builds would work, publishing would work, but the function would complain about unable to bind to Table Storage in the portal. After hours of root-cause analysis, i found this (above workaround) was the issue - so just be aware.
Any updates on this issue?
I've to do just like RAAAAN said.
@lommez would you be able to share the information requested by @soninaren and open a new issue with the details?
@soninaren here is my csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<AzureFunctionsVersion>v1</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.24" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
</Project>
Locking the conversation on this issue. Have created a new issue referencing the last comment.
Most helpful comment
While trying to Package the solution I found a Setting in the File:
"MyUserDirectory".nugetpackagesmicrosoft.azure.webjobs.script.extensionsmetadatagenerator1.0.1buildMicrosoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets
<Target Name="_GenerateFunctionsExtensionsMetadataPostPublish" AfterTargets="Publish"> <GenerateFunctionsExtensionsMetadata SourcePath="$(PublishDir)bin" OutputPath="$(PublishDir)bin"/> </Target>I changed it to:
<Target Name="_GenerateFunctionsExtensionsMetadataPostPublish" AfterTargets="Publish"> <GenerateFunctionsExtensionsMetadata SourcePath="$(PublishDir)" OutputPath="$(PublishDir)"/> </Target>And now I can Publish again