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.

Custom module with 3. party dependencies assembly load error

See original GitHub issue

I am using a custom module for importing and exporting parquet data. The module can be found here: PSParquet

The module works on PowerShell 7.x on both Windows and Linux, but on WindowsPowerShell the module generates this error:

Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or
one of its dependencies. The system cannot find the file specified.

I want to run the module in Azure Functions PowerShell Worker, but there I get the exact same error - both when debugging locally and on an actual Azure Function.

My function is setup with powerShellVersion: '~7', FUNCTIONS_EXTENSION_VERSION: '~3' and FUNCTIONS_WORKER_RUNTIME: 'powershell'. Stack Settings show Stack: PowerShell Core and `PowerShell Core Version: PowerShell 7.0

I do not need to run the module in WindowsPowerShell and I was under the impression, that Azure Functions PowerShell Worker ran in an isolated environment. Unfortunately, that does not seem to be the case here.

I have been running Azure PowerShell functions whit custom modules for years, but this is my first go with a custom C# module with dll dependencies. I am actually able to run the module in a container and I have thought about deploying a container in stead of using Azure Functions, but I would REALLY prefer to make the Azure Function work instead.

Can you point me in the right direction for getting this up and running in Azure Functions?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
Agazothcommented, Jan 26, 2022

@Francisco-Gamino I can confirm the following: Language version: 7.2.0-preview.9 FUNCTIONS_WORKER_RUNTIME_VERSION: 7.2 func version:. 4.0.3971 dotner version: 6.0.101

AND: now it works! Guess a reboot fixed it …

Thank you for your support. Any update on when will this be available in Azure?

2reactions
AnatoliBcommented, Jan 20, 2022

@Agazoth You can also try out PowerShell 7.2 support locally right now:

  • Make sure you have the latest Core Tools v4.x installed.
  • In local.setting.json, set FUNCTIONS_WORKER_RUNTIME_VERSION to 7.2
Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not load file or assembly or one of it's dependencies ...
As the error say The module was expected to contain an assembly manifest. Neither this project nor other projects have a file named...
Read more >
Best practice to avoid assembly conflicts when custom ...
Best practice to avoid assembly conflicts when custom extensions load same Third Party assemblies with different versions. Rich Talbot. 2 ...
Read more >
Unable to load multiple versions of .Net assembly module ...
I can't update 3rd party modules to use newer dlls versions. So I'm ... Unable to load multiple versions of .Net assembly module...
Read more >
Best Practices for Assembly Loading - .NET Framework
The assembly is loaded without any context, so its dependencies are not automatically loaded. You might have a handler for the AppDomain.
Read more >
Could not load file or assembly...Oh my! How I went ...
Application uses a third-party dependency and authors have made changes that resulted in different public/private key pair that doesn't correspond with the one ......
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