question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BAD IL Format when referencing a project that uses Microsoft.Azure.Cosmos nuget.

See original GitHub issue

Describe the issue

BAD IL Format when referencing a project that uses CosmosDb nuget.

To Reproduce Steps to reproduce the behavior:

  1. Created an Out of Process as described in the sample projects. (https://github.com/Azure/azure-functions-openapi-extension/tree/4ab23d7e144370f9f2d7eb9d7e2b2daea1878a2d/samples/Microsoft.Azure.Functions.Worker.Extensions.OpenApi.FunctionApp.OutOfProc)
  2. Reference another project that references CosmosDB library (Microsoft.Azure.Cosmos v3.25.0)
  3. Run the project
  4. See error: Bad IL format. The format of the file '.../bin/Debug/net6.0/Microsoft.Azure.Cosmos.ServiceInterop.dll' is invalid.

Expected behavior Swagger UI run without errors.

Screenshots image

Environment (please complete the following information, if applicable):

  • OS: MacOs

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
justinyoocommented, Mar 28, 2022

This has been released to v1.3.0. Thanks for waiting!

2reactions
willyt150commented, Mar 9, 2022

Running into similar issue on Windows and when deployed up into azure linux consumption plan.

Issue shows up in version 1.2.0.

1.0.0 and 1.1.0 both do not have the issue.

Error in my case is: Bad IL format. The format of the file '...\bin\Debug\net6.0\Cosmos.CRTCompat.dll' is invalid.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Bad IL format - Strange .NET error
NET Framework. Make sure that the file image is a valid managed assembly or module.
Read more >
Troubleshooting NuGet Package Restore in Visual Studio
This error occurs when you attempt to build a project that contains references to one or more NuGet packages, but those packages are...
Read more >
BadImageFormatException (Bad IL format) after detatching ...
Create a C# ASP.NET Core 2.1 Web (Razor) application. 2. Publish it to an Azure App Service. 3. Using Cloud Explorer, attach the...
Read more >
Azure Cosmos DB Change Feed
In this lab you will use the Change Feed Processor Library and Azure Functions to implement three use cases for the Azure Cosmos...
Read more >
Apps and Services With . NET 7
Using an emulator on Windows to create Azure Cosmos DB resources • 120 ... In the CodeAnalyzing project, add a package reference for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found