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

Core Tools updates to use out-of-process host by default #3744

Open
mattchenderson opened this issue Jul 5, 2024 · 4 comments · May be fixed by #3802
Open

Core Tools updates to use out-of-process host by default #3744

mattchenderson opened this issue Jul 5, 2024 · 4 comments · May be fixed by #3802
Assignees

Comments

@mattchenderson
Copy link
Contributor

The Core Tools should switch to use the out-of-process host for out-of-process stacks. Today, it still uses the .NET 6 in-process host, unless it knows it needs to use the .NET 8 in-process host.

This item requires additional design. A few quick notes:

  • This is a variant of what was done to support .NET 8 in-process.
    • The out-of-process host should be used unless we have a signal which tells us to instead use the .NET 6 in-process host.
    • We should allow the start operation to be forced to launch the right version via a parameter.
  • Special consideration needs to be given for Visual Studio

We should expect this to be at least a minor version bump.

@aishwaryabh
Copy link
Contributor

This is the format we will be using: func <command> --runtime default|inproc6|inproc8

@alesrosina
Copy link

Is there a way to run in proc locally already? On Azure there is a env var that needs to be set FUNCTIONS_INPROC_NET8_ENABLED to 1.

Is this what you are talking about here? and when can we expect this function?

I'm interested, since from upgrade to .net 8 of our project I cannot develop locally on linux machine with this tools installed. Maybe I'm doing sth wrong, but on Windows it was resolved with grabing latest version.

Error configuring services in an external startup class. Microsoft.Azure.WebJobs.Extensions.OpenApi.Configuration.AppSettings: Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
A host error has occurred during startup operation 'c5b747ea-a46e-423c-aafe-969ea9df9f6e'.
Microsoft.Azure.WebJobs.Script: Error configuring services in an external startup class. Microsoft.Azure.WebJobs.Extensions.OpenApi.Configuration.AppSettings: Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

Value cannot be null. (Parameter 'provider')

@aishwaryabh aishwaryabh self-assigned this Aug 28, 2024
@aishwaryabh aishwaryabh linked a pull request Aug 28, 2024 that will close this issue
5 tasks
@mattchenderson
Copy link
Contributor Author

Is there a way to run in proc locally already? On Azure there is a env var that needs to be set FUNCTIONS_INPROC_NET8_ENABLED to 1.

Is this what you are talking about here? and when can we expect this function?

I'm interested, since from upgrade to .net 8 of our project I cannot develop locally on linux machine with this tools installed. Maybe I'm doing sth wrong, but on Windows it was resolved with grabing latest version.

Error configuring services in an external startup class. Microsoft.Azure.WebJobs.Extensions.OpenApi.Configuration.AppSettings: Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
A host error has occurred during startup operation 'c5b747ea-a46e-423c-aafe-969ea9df9f6e'.
Microsoft.Azure.WebJobs.Script: Error configuring services in an external startup class. Microsoft.Azure.WebJobs.Extensions.OpenApi.Configuration.AppSettings: Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

Value cannot be null. (Parameter 'provider')

@alesrosina To use the Core Tools with .NET 8 on the in-process model, you must provide the FUNCTIONS_INPROC_NET8_ENABLED setting in the local environment, typically through local.settings.json. You must also explicitly have FUNCTIONS_WORKER_RUNTIME set to "dotnet". There was an issue with Linux that was identified (#3766) which has since been addressed, though that does present a different error than the one you shared. Your error implies to me that a .NET 8 project is being loaded by a .NET 6 host. Regardless, I would recommend re-attempting your Linux tests with the latest version, and ensuring both of those settings are included in your local.settings.json. If you are still seeing something wrong after that, please open a new issue.

The work tracked by this item is separate, though it will introduce an additional option (the flag mentioned in Aishwarya's comment above) when invoking directly via the command line. When we originally introduced support for .NET 8 on the in-process model, we had to change some mechanics of how the Core Tools and the host interact. This work extends and generalizes those changes a bit. Other than the introduction of that new flag, we expect no changes for .NET 8 on the in-process model as a result of this.

@alesrosina
Copy link

FUNCTIONS_INPROC_NET8_ENABLED

@mattchenderson this was my issue, yes. I guess I've missed this somewhere, that this should be in local.settings.json. Thanks, it works now for me!

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

Successfully merging a pull request may close this issue.

3 participants