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

Could not load type 'Microsoft.Azure.WebJobs.Hosting.IWebJobsStartup2' #54

Open
afetter opened this issue Oct 8, 2020 · 16 comments
Open

Comments

@afetter
Copy link

afetter commented Oct 8, 2020

When I install azure-functions-dotnet-extensions to be able to do a Startup class.

The error i got is:

System.Private.CoreLib: Could not load type 'Microsoft.Azure.WebJobs.Hosting.IWebJobsStartup2' from assembly 'Microsoft.Azure.WebJobs.Host, Version=3.0.17.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

But the project reference is poiting to 3.0.18.0.

image

I'm having this problem on mac.

@sowmini
Copy link

sowmini commented Oct 8, 2020

Facing the same issue on Mac.

System.Private.CoreLib: Could not load type 'Microsoft.Azure.WebJobs.Hosting.IWebJobsStartup2' from assembly 'Microsoft.Azure.WebJobs.Host, Version=3.0.17.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

Project reference pointing to 3.0.22.


Screen Shot 2020-10-08 at 1 52 24 PM

@afetter
Copy link
Author

afetter commented Oct 8, 2020

I tested the exact same code on Windows 10 and it works fine. Also, I publish it to azure, and it works as well.

@sowmini
Copy link

sowmini commented Oct 8, 2020

I was able to fix the issue after downgrading the 'Azure.Functions.Extensions' package to 1.0.0. Give it a shot!

@viniciuschiele
Copy link

I'm also facing this issue on mac, I have installed Azure Functions Core Tools version 3.0.2931.

It does work when I run func start in the terminal.

@abjoseph
Copy link

abjoseph commented Oct 28, 2020

I can confirm that this is NOT only occuring on Mac, I'm facing this issue on Windows 10, using both Visual Studio 2019 and VSCode. Additionally, VSCode fails silently and doesn't even show the error.

I can confirm that this bug was introduce in version 1.1.0 of Microsoft.Azure.Functions.Extensions and that downgrading to 1.0.0 removes the issue.

@wterpstra
Copy link

wterpstra commented Nov 4, 2020

Is there any other workaround than downgrading Microsoft.Azure.Functions.Extensions from 1.1.0 to 1.0.0? I need to be able to modify the IConfigurationBuilder and access my configuration from my Startup class which is not possible with 1.0.0.

@aandino-dev
Copy link

Hi @wterpstra

I only have the issue running from Visual Studio. The terminal and Visual Studio are giving me distinct versions. From terminal no issues running funct start

From Visual Studio

Azure Functions Core Tools (3.0.2358 Commit hash: d6d66f19ea30fda5fbfe068fc22bc126f0a74168)
Function Runtime Version: 3.0.13159.0

Terminal

Azure Functions Core Tools
Core Tools Version: 3.0.2996 Commit hash: c54cdc36323e9543ba11fb61dd107616e9022bba
Function Runtime Version: 3.0.14916.0

@rochapablo
Copy link

rochapablo commented Nov 18, 2020

Downgrade to 1.0.0 it did work.

@chrizzo84
Copy link

I only have that error when trying to debug in VS for Mac => When starting with "func start" in Terminal it is working fine with 1.1.0.
When downgrading to 1.0.0 it is also working in VS for Mac.

@realrubberduckdev
Copy link

I just installed the latest azure-functions-core-tools and I do not get this load error anymore.

npm install -g azure-functions-core-tools@3
func --version
3.0.2996

@prashanthsarma
Copy link

prashanthsarma commented Dec 29, 2020

For me npm install didn't work as the VStudio Mac was still using files from following folder
/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/MonoDevelop.AzureFunctions/azure-functions-cli
VSMac would show the version as:
Azure Functions Core Tools (3.0.2358 Commit hash: d6d66f19ea30fda5fbfe068fc22bc126f0a74168)
Function Runtime Version: 3.0.13159.0

The normal func start with npm had version as:
Core Tools Version: 3.0.3160 Commit hash: 00aa7f43cc5c5f15241b5e6e5363256f19ceb990
Function Runtime Version: 3.0.14916.0

So, I manually duplicated the folder for falling back and copied new dlls from the npm or homebrew install at /usr/local/lib/node_modules/azure-functions-core-tools/bin to the Visual Studio.app folder mentioned above

I have no idea of compatibility with any other VS mac integrations

@Glorfindel83
Copy link

Glorfindel83 commented Feb 10, 2021

A colleague of mine had this issue as well (while it was working fine on my Mac); it turns out it's possible to update the Core Tools used by Visual Studio for Mac by updating the list of templates you have when creating a new Azure Function in your solution/project. Credits to Stack Overflow user Matt Ward here.

@rhythmnewt
Copy link

I can confirm after running into the same problem that Core Tools update from within Visual Studio for Mac (v8) solved it for me. It was not very obvious how to do the update.

You have to create a new project and select Azure Functions as project type then on the next screen "Configure your Azure Functions Project" there will be a small "refresh" icon under all the trigger templates. That's the button that will install and update all the latest required bits.

@camarandei
Copy link

In my case (Visual Studio, Version 16.9.4, Windows 10) I have solved this problem by renaming the folder 3.4.1 (I couldn't remove it) from the path: C:\Users[User]\AppData\Local\AzureFunctionsTools\Releases . Then next time I have started my azure functions project, a new folder(3.18.0) was created on that path.

@JRyGithub
Copy link

In my case did as @rhythmnewt did above. I created a new project, when selecting the project type I clicked update templates. Then closed the project reopened my actual project and I was golden!

@DureSameen
Copy link

I am on mac, I am facing same issue.

I have installed 3.~ latest version of azure-functions-core-tools.

brew tap azure/functions
brew install azure-functions-core-tools@3
brew link --overwrite azure-functions-core-tools@3

and it gives me this message

Warning: azure/functions/azure-functions-core-tools@3 3.0.3904 is already installed and up-to-date.

But when i run visual studio for mac 2019 and 2022 both are showing Azure Functions Core Tools (3.0.2358 )

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

No branches or pull requests