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

4.0.5530: Could not load file or assembly 'Microsoft.Azure.WebJobs.Script.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3c5b9424214e8f8c'. The system cannot find the file specified. #3602

Open
jaliyaudagedara opened this issue Feb 20, 2024 · 12 comments
Assignees
Labels

Comments

@jaliyaudagedara
Copy link

jaliyaudagedara commented Feb 20, 2024

I have just updated Azure Functions Core Tools version in my local machine to the latest (4.0.5530) and now func start is failing.

> func --version
4.0.5530

> func init --worker-runtime dotnet-isolated
Writing C:\Users\Jaliya\Desktop\test-function\.vscode\extensions.json

> func new --template "Http Trigger" --name HttpStart
Template: Http Trigger
Function name: HttpStart

Creating dotnet function...
The function "HttpStart" was created successfully from the "Http Trigger" template.

> func start --verbose
MSBuild version 17.9.4+90725d08d for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  test-function -> C:\Users\Jaliya\Desktop\test-function\bin\output\test-function.dll
  Determining projects to restore...
  Restored C:\Users\Jaliya\AppData\Local\Temp\szmnpezk.rm0\WorkerExtensions.csproj (in 669 ms).
  WorkerExtensions -> C:\Users\Jaliya\AppData\Local\Temp\szmnpezk.rm0\buildout\Microsoft.Azure.Functions.Worker.Extensions.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:03.43



                  %%%%%%
                 %%%%%%
            @   %%%%%%    @
          @@   %%%%%%      @@
       @@@    %%%%%%%%%%%    @@@
     @@      %%%%%%%%%%        @@
       @@         %%%%       @@
         @@      %%%       @@
           @@    %%      @@
                %%
                %


Azure Functions Core Tools
Core Tools Version:       4.0.5530 Commit hash: N/A +c8883e7f3c06e2b424fbac033806c19d8d91418c (64-bit)
Function Runtime Version: 4.28.5.21962

Could not load file or assembly 'Microsoft.Azure.WebJobs.Script.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3c5b9424214e8f8c'. The system cannot find the file specified.

However, it runs fine with in Visual Studio:
image

@jaliyaudagedara
Copy link
Author

jaliyaudagedara commented Feb 20, 2024

Downgraded Azure Functions Core Tools back to 4.0.5455, it works.

I am sorry guys, this isn't cool. Lately, there seem to be a lot of breaks.

>  func start
MSBuild version 17.9.4+90725d08d for .NET
  Determining projects to restore...
  Restored C:\Users\Jaliya\Desktop\test-function\test-function.csproj (in 334 ms).
  test-function -> C:\Users\Jaliya\Desktop\test-function\bin\output\test-function.dll
  Determining projects to restore...
  Restored C:\Users\Jaliya\AppData\Local\Temp\crxzujxi.c5l\WorkerExtensions.csproj (in 423 ms).
  WorkerExtensions -> C:\Users\Jaliya\AppData\Local\Temp\crxzujxi.c5l\buildout\Microsoft.Azure.Functions.Worker.Extensions.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:03.29


Azure Functions Core Tools
Core Tools Version:       4.0.5455 Commit hash: N/A  (64-bit)
Function Runtime Version: 4.27.5.21554

[2024-02-20T17:34:19.597Z] Found C:\Users\Jaliya\Desktop\test-function\test-function.csproj. Using for user secrets file configuration.

Functions:

        HttpStart: [GET,POST] http://localhost:7071/api/HttpStart

For detailed output, run func with --verbose flag.
[2024-02-20T17:34:21.216Z] Worker process started and initialized.
[2024-02-20T17:34:25.851Z] Host lock lease acquired by instance ID '000000000000000000000000CF6A328F'.

@mattchenderson
Copy link
Contributor

mattchenderson commented Feb 21, 2024

@jaliyaudagedara Thanks for opening this and providing those repro steps! I can confirm the repro on my setup. I agree with your suggested mitigation of pinning back for anyone impacted by this until it can be resolved.

Edit: Also able to confirm that VS has been working fine with this version, which is indeed curious. As a coherence check, I took a working VS project and manually ran func start on the command line. Same issue. And if I open the project created by the Core Tools in VS and run it there, it works fine. VS does have its own installation of the Core Tools, but the stated commit hashes seem to match, too, so in theory it's the same bits in both contexts...

@jaliyaudagedara
Copy link
Author

@mattchenderson,

No problem.

but the stated commit hashes seem to match, too, so in theory it's the same bits in both contexts...

Yeah, I checked that as well, have no clue what the difference is.

@mattchenderson
Copy link
Contributor

How had you performed the update? I did it through winget for mine, which ultimately uses the MSI.

VS actually pulls down everything directly as a zip. Comparing the two, it seems like the MSI is just not including Microsoft.Azure.WebJobs.Script.Abstractions.dll for some reason, but the version VS has includes that.

@jaliyaudagedara
Copy link
Author

Interesting. I used winget as well.

@mattchenderson
Copy link
Contributor

I just attempted a repair through the MSI and that seems to have fixed it. I have no idea why the initial installation would have missed that. I wonder if a clean first install as opposed to the winget update Microsoft.Azure.FunctionsCoreTools path would be different? I might give that a try tomorrow to see.

@jaliyaudagedara
Copy link
Author

jaliyaudagedara commented Feb 21, 2024

Did some testing.

1. I am on 4.0.5455 (C:\Program Files\Microsoft\Azure Functions Core Tools is not empty). Downloaded the 4.0.5530 MSI, and installed (technically this is an update from 4.0.5455 to 4.0.5530).

Same error :(

2. Ran the MSI again (C:\Program Files\Microsoft\Azure Functions Core Tools is not empty of course), but this time (like you) did a Repair.

That worked :)

3. Uninstalled Azure Functions Core Tools (C:\Program Files\Microsoft\Azure Functions Core Tools was deleted by the uninstaller). Installed 4.0.5530 from MSI.

That worked :)

Findings

Copied C:\Program Files\Microsoft\Azure Functions Core Tools at each scenario and compared.
image

Missing Files/Folders

$notWorkingDirPath = "C:\Users\Jaliya\Desktop\Azure Functions Core Tools-AfterUpdate"
$workingDirPath = "C:\Users\Jaliya\Desktop\Azure Functions Core Tools-AfterRepair"
robocopy $workingDirPath $notWorkingDirPath /e /l /ns /njs /njh /ndl /fp

image

So it's definitely something to do with the installer when doing an update.

@thomasneuberger
Copy link

Uninstalling and reinstalling via winget did the trick for me.

winget uninstall Microsoft.Azure.FunctionsCoreTools
winget install Microsoft.Azure.FunctionsCoreTools

@mattchenderson
Copy link
Contributor

Noting that I just got a separate report of this happening on npm / via the VS Code install path. I have not attempted that repro myself.

@levalencia
Copy link

I am having the same issue but my core tools is:
Azure Functions Core Tools
Core Tools Version: 4.0.5571 Commit hash: N/A +9a5b604f0b846df7de3eb37b423a9eba8baa1152 (64-bit)
Function Runtime Version: 4.30.0.22097

I get the error when I do func host start

@levalencia
Copy link

strange:
this winget install Microsoft.Azure.FunctionsCoreTools downloads the 530 version
but the link above downloads 571!

@yooakim
Copy link

yooakim commented Mar 16, 2024

Same issue for me as well:

Azure Functions Core Tools
Core Tools Version:       4.0.5530 Commit hash: N/A +c8883e7f3c06e2b424fbac033806c19d8d91418c (64-bit)
Function Runtime Version: 4.28.5.21962

following @thomasneuberger advice on uninstall/reinstall using winget solved it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants