Azure-Functions icon indicating copy to clipboard operation
Azure-Functions copied to clipboard

System.Private.CoreLib: Could not load file or assembly azure function

Open vijayrkn opened this issue 4 years ago • 4 comments

Creating this issue on behalf of the VS customer. Details of the issue are available here.

https://developercommunity.visualstudio.com/content/problem/953719/systemprivatecorelib-could-not-load-file-or-assemb.html

There is a screenshot of the func cli error available under the diagnostics section in the bug.

vijayrkn avatar Apr 06 '20 21:04 vijayrkn

i also have this issue with azure function. I already tried if this is related to azure function which runs on a linux app service plan but it doesn't.

csproj setup:

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <AzureFunctionsVersion>v3</AzureFunctionsVersion>
    <_FunctionsSkipCleanOutput>false</_FunctionsSkipCleanOutput>
  </PropertyGroup>

host.json

{
    "version": "2.0",
    "logging": {
        "applicationInsights": {
            "samplingExcludedTypes": "Request",
            "samplingSettings": {
                "isEnabled": true
            }
        }
    }
}

error in the azure portal console: System.Private.CoreLib: Value cannot be null. (Parameter 's'). image

ChangeTheCode avatar Oct 21 '20 05:10 ChangeTheCode

Hitting the same issue. Were you able to find a solution?

shailahirji avatar Jun 27 '21 12:06 shailahirji

Imho most probably you try Environment.GetEnvironmentVariable("somevariable") somewhere and you don't have that "somevariable" in either local.settings.json when running locally, or in azure configuration when running in Azure. At least that's what was causing me this error.

mhgames avatar May 02 '22 10:05 mhgames

@mhgames thanku for your comment. i almost went bald looking for the solution and issue was spell mistake in app settings vairable

rohanrhirave avatar Oct 12 '22 13:10 rohanrhirave