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

Can't run Functions v2 on OSX after update #3418

Closed
likwidgames opened this issue Sep 9, 2018 · 10 comments
Closed

Can't run Functions v2 on OSX after update #3418

likwidgames opened this issue Sep 9, 2018 · 10 comments

Comments

@likwidgames
Copy link

Ever since I updated my packages to Microsoft.NET.Sdk.Functions 1.0.19, I can no longer test my builds in Visual Studio Mac. I am presented with the error below. I have tried updating my Visual Studio (stable, beta and alpha) but they don't seem to be updating the runtime version to 2.0.12x, so I'm stuck with 2.0.119, which is not supported with the latest version of the Functions Sdk.. Is there a way to manually do this?

[2018-09-09 4:44:15 AM] Reading host configuration file '/Users/mike/Documents/Visual Studio 2017/Projects/Tests/AuthTests/bin/Debug/netstandard2.0/host.json'
[2018-09-09 4:44:15 AM] Host configuration file read:
[2018-09-09 4:44:15 AM] {}
[2018-09-09 4:44:15 AM] Starting Host (HostId=mikesmacbookpro-1782003714, InstanceId=4dad6d8c-c7b2-4876-8ce0-cef154e97eda, Version=2.0.11933.0, ProcessId=6817, AppDomainId=1, Debug=False, ConsecutiveErrors=0, StartupCount=1, FunctionsExtensionVersion=)
[2018-09-09 4:44:17 AM] A ScriptHost error has occurred
[2018-09-09 4:44:17 AM] System.Private.CoreLib: Could not load type 'Microsoft.Azure.WebJobs.Hosting.IWebJobsStartup' from assembly 'Microsoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null'.
[2018-09-09 4:44:18 AM] Stopping Host
Function host is not running.

@ossentoo
Copy link

similar error on my mac as well after an upgrade to the solution:

Reading host configuration file '/Users/user1/Documents/source/vsts/organisation/src/project/bin/Debug/netstandard2.0/host.json'
[13/09/2018 16:02:26] Host configuration file read:
[13/09/2018 16:02:26] {}
[13/09/2018 16:02:26] Starting Host (HostId=macbookpro-1313198492, InstanceId=b06ca2bc-8109-4ecd-b83b-4c138ece884e, Version=2.0.11933.0, ProcessId=61880, AppDomainId=1, Debug=False, ConsecutiveErrors=1, StartupCount=2, FunctionsExtensionVersion=beta)
[13/09/2018 16:02:26] A ScriptHost error has occurred
[13/09/2018 16:02:26] System.Private.CoreLib: Could not load type 'Microsoft.Azure.WebJobs.ExecutionContext' from assembly 'Microsoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null'.
[13/09/2018 16:02:26] Stopping Host

Note that this same project works on Visual Studio 2017 15.8.2 and version 15.8.5023 of the Azure Functions and Web Jobs Tools package.

Version 2.5.2 of the Azure Functions Cli tools is also installed for Windows.

I don't know how to updat the host version from that highlighted above to the latest version. I have tried following these instructions, for cli tools installation but this doesn't appear to have changed anything when running the function.

https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local

Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
No changes to formulae.

==> Installing azure-functions-core-tools from azure/functions
==> Downloading https://functionscdn.azureedge.net/public/2.0.1-beta.38/Azure.Functions.Cli.osx-x64.2.0.1-beta.38.zip
######################################################################## 100.0%
🍺 /usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.38: 458 files, 214.2MB, built in 42 seconds

@ianadavies
Copy link

I'm getting this also. Has anybody found a fix for this yet ?

@c-mccutcheon
Copy link

Also getting this issue after a fresh install of all tools. Local SDKS and Nuget packages upgraded to latest, but host still running the same version as above, bump?

@ianadavies
Copy link

ianadavies commented Sep 21, 2018

I found this page
#3363

and

this page
Azure/app-service-announcements#129

My problem is the execution context issue. It's not obvious if I need to install all of these packages or just the ones I use

NuGet Package Version
Microsoft.NET.Sdk.Functions 1.0.19
Microsoft.Azure.WebJobs.Extensions.CosmosDB 3.0.1-beta2
Microsoft.Azure.WebJobs.Extensions.DurableTask 1.6.0
Microsoft.Azure.WebJobs.Extensions.MicrosoftGraph 1.0.0-beta4
Microsoft.Azure.WebJobs.ServiceBus 3.0.0-beta8
Microsoft.Azure.WebJobs.Extensions.EventHubs 3.0.0-beta8
Microsoft.Azure.WebJobs.Extensions.SendGrid 3.0.0-beta8
Microsoft.Azure.WebJobs.Extensions.EventGrid 2.0.0-beta4
Microsoft.Azure.WebJobs.Extensions.Storage 3.0.0-beta8
Microsoft.Azure.WebJobs.Extensions.Twilio 3.0.0-beta8
Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator 1.0.0

I'm going to try all as the ExecutionContext might need to be aware of all possible triggers

@Natoito
Copy link

Natoito commented Sep 24, 2018

I had the same similar issue:
System.Private.CoreLib: Could not load type 'Microsoft.Azure.WebJobs.Hosting.IWebJobsStartup' from assembly 'Microsoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null'.

I typed this command: npm install -g azure-functions-core-tools.

My current setup:

Azure Functions Core Tools: 2.0.3
Functions Runtime : 2.0.12115.0
Microsoft.NET.Sdk.Functions: 1.0.22
Microsoft.Azure.WebJobs.Extensions.CosmosDB: 3.0.1
Microsoft.Azure.WebJobs.Extensions.SendGrid: 3.0.0
Microsoft.Azure.Management.Fluent: 1.15.1

@ianadavies
Copy link

Ok got really fed up with this. I noticed there were some updates to Visual Studio Mac on the Alpha Channel for Azure functions. I downloaded the updates but it still didn't work.

I also re-installed Azure Functions Core Tools using brew

brew tap azure/functions
brew install azure-functions-core-tools

and still didn't help :/

I am mentioning the above as I don't know if they are pre-requisites to the next step that worked!

I then found this link

Azure/azure-functions-core-tools#697

And did this as suggested.

dotnet publish src/Azure.Functions.Cli/Azure.Functions.Cli.csproj --runtime osx-x64 --output /tmp/cli 

# then do
/tmp/cli/func start 

You have to copy over your local settings.json file and then it worked for me.

@markosaric
Copy link

At this moment, it is possible to run the function project in VS code where Functions v2 are working on macOS. Unfortunately, currently, Functions Runtime =>2.0.12050 isn't working in Visual Studio Mac.
This is described in the following post: Azure/azure-webjobs-sdk#1905 (comment)

@pragnagopa
Copy link
Member

Is this still an issue?

@ossentoo
Copy link

ossentoo commented Jul 19, 2019 via email

@ghost
Copy link

ghost commented Jul 23, 2019

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost ghost added the no-recent-activity label Jul 23, 2019
@ghost ghost closed this as completed Jul 26, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Jan 1, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants