Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug output: Metadata generation failed. Exit code: '-1073741818' #5847

Closed
euo opened this issue Apr 1, 2020 · 7 comments
Closed

Debug output: Metadata generation failed. Exit code: '-1073741818' #5847

euo opened this issue Apr 1, 2020 · 7 comments

Comments

@euo
Copy link

euo commented Apr 1, 2020

I'm trying a simple Azure Function in VS 2019 but getting the following error when debugging.

Environment:

Microsoft Visual Studio Community 2019
Version 16.5.0
VisualStudio.16.Release/16.5.0+29911.84
Microsoft .NET Framework
Version 4.8.03752

Microsoft.Azure.WebJobs.Extensions.CosmosDB 3.0.5
Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator 1.1.6
Microsoft.NET.Sdk.Functions 3.0.1

Microsoft Azure Cosmos Emulator 2.9.2.0

Repro steps

  1. Create new Azure Function project in Visual Studio.
  2. Update local.settings.json with Cosmos connection string
  3. Verify that Cosmos database, collection, connectionString are correct in Function1.cs
  4. Ensure MyCosmosDB database and Games collection exists in CosmosDB
  5. Hit F5 to debug

Expected behavior

Should build and debug without error.

Actual behavior

1>------ Build started: Project: CosmosFunctions, Configuration: Debug Any CPU ------
1>CosmosFunctions -> D:\source\CosmosFunctions\bin\Debug\netcoreapp3.0\bin\CosmosFunctions.dll
1>Debug output from extension.json generator:
1>
1>C:\Users\mario.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.1.6\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(44,5): error : Metadata generation failed. Exit code: '-1073741818' Error: ''
1>Done building project "CosmosFunctions.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Known workarounds

Tried steps and work around made by other developers here:
#4055
#4578
#5229

Related information

Provide any related information

  • Programming language used
  • Links to source
  • Bindings used
Source
public static class GamesFunction
    {
        [FunctionName("Games_OnStatusFinalized")]
        public static void Run([CosmosDBTrigger(
            databaseName: "MyCosmosDB",
            collectionName: "Games",
            ConnectionStringSetting = "CosmosDBConn",
            LeaseCollectionName = "leases",
            CreateLeaseCollectionIfNotExists =true,
            LeaseCollectionPrefix ="")]IReadOnlyList<Document> input, ILogger log)
        {
            if (input != null && input.Count > 0)
            {
                log.LogInformation("Documents modified " + input.Count);
                log.LogInformation("First document Id " + input[0].Id);
            }
        }
    }
</details>

<details>
<summary>Source</summary>

```json
{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet",
    "CosmosDBConn": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw=="
  },
  "Host": {
    "LocalHttpPost": 7071,
    "CORS": "http://localhost:3872",
    "CORSCredentials": true
  }
}</details>
@ghost ghost assigned kashimiz Apr 1, 2020
@kashimiz
Copy link
Contributor

Hi @euo, thank you for reporting this issue. My apologies for the delayed reply. Can you share your *.csproj file?

@ghost
Copy link

ghost commented Apr 20, 2020

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.

@euo
Copy link
Author

euo commented Apr 21, 2020

Thanks for the response, @kashimiz.

here's my project file:

<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netcoreapp3.0</TargetFramework> <AzureFunctionsVersion>v3</AzureFunctionsVersion> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.CosmosDB" Version="3.0.5" /> <PackageReference Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" Version="1.1.6" /> <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.1" /> </ItemGroup> <ItemGroup> <None Update="host.json"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> <None Update="local.settings.json"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToPublishDirectory>Never</CopyToPublishDirectory> </None> </ItemGroup> </Project>

@ThejaChoudary
Copy link

@kashimiz can you please look into this further.

@v-anvari v-anvari self-assigned this Nov 23, 2020
@v-anvari
Copy link

Hi @euo, I have tried to reproduce the scenario with the latest packages, but was able to build successfully. Let us know if you are still facing the same issue with build.

========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
microsoft.net.sdk.functions\3.0.7

@ghost
Copy link

ghost commented Nov 28, 2020

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.

@v-anvari
Copy link

v-anvari commented Dec 1, 2020

Please feel free to re-open the issue if the issues re-occur

@v-anvari v-anvari closed this as completed Dec 1, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants