Azure / Azure/azure-functions-host

Improve error message when publishing a 64 bit function when the app is set to 32 bit in the portal

Open
#6,387 1 comment 0 reactions 1 assignee Claimed by @pragnagopa View on GitHub
supportability supportability: error-message-improvement
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 10h
Merged PRs (30d)
36

Description

We published a function with zip deployment which was built for 64 bit platform. The function did not work due to an error shown in the portal`System.Private.CoreLib: Could not load file or assembly ', Version=1.0.0.0, Culture=neutral, PublicKeyToken=null`

We found the error in the logs with the full callstack and still it showed the same message.

Normally you see something like "An attempt was made to load a program with an incorrect format" but that was not present here so we assumed it was something else.

Eventually we found the setting in the portal in General Settings which allows you to change from 32 to 64 bit and then it started working.

It would have been much easier to diagnose if the error had mentioned the reason for failing to load the assembly, also if there was some check at deployment time for the function app compatibility.

#### Investigative information

Please provide the following:

- Timestamp:
- Function App version: 3
- Function App name: dpooletest
- Function name(s) (as appropriate): ServiceTreeScraperFunc
- Invocation ID: ?
- Region: West US 2

#### Repro steps

Provide the steps required to reproduce the problem:

Create a new function app from portal specifying dotnet 3.1 etc

Create an empty function app with 64 bit binaries

mkdir Test
cd Test
dotnet new func --name Test
func new (answer the questions to create a C# timer function)

dotnet publish -r win-x64 -o ./publish
pushd ./publish/&&zip -r func.zip .&&popd
az functionapp deployment source config-zip -g -n

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.