Azure / Azure/azure-functions-host

Script compilation failed.

Open
#2,705 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 10h
Merged PRs (30d)
36

Description

After adding Nuget package 'SharePointPnPCoreOnline' i get an error with every try to run function

**project.json**
```
{
"frameworks": {
"net46": {
"dependencies": {
"SharePointPnPCoreOnline": "2.25.1804.1"
}
}
}
}
```

#### Investigative information

Please provide the following:

- Timestamp:
- Function App version (1.0 or 2.0-beta): 1.0
- Function App name: BSGFunctionApp
- Function name(s) (as appropriate): HttpTriggerCSharp1
- Invocation ID: not sure, may be this cb0120ba-d257-4f63-a805-a9279c4ac389
- Region: don't know

#### Repro steps

1. Create a new C# HTTP trigger function
2. add 'SharePointPnPCoreOnline' NuGet package
3. Run

#### Actual behavior

`
{
"id": "cb0120ba-d257-4f63-a805-a9279c4ac389",
"requestId": "7c0fd7ce-0a67-447c-90fc-9b83028343b1",
"statusCode": 500,
"errorCode": 0,
"message": "An error has occurred. For more information, please check the logs for error ID cb0120ba-d257-4f63-a805-a9279c4ac389"
}
`

**In logs**
```
Exception while executing function: Functions.HttpTriggerCSharp1
Microsoft.Azure.WebJobs.Host.FunctionInvocationException : Exception while executing function: Functions.HttpTriggerCSharp1 ---> Microsoft.CodeAnalysis.Scripting.CompilationErrorException : Script compilation failed.
at async Microsoft.Azure.WebJobs.Script.Description.DotNetFunctionInvoker.CreateFunctionTarget(CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-script\src\WebJobs.Script\Description\DotNet\DotNetFunctionInvoker.cs : 338
at async Microsoft.Azure.WebJobs.Script.Description.FunctionLoader`1.GetFunctionTargetAsync[T](Int32 attemptCount) at C:\projects\azure-webjobs-sdk-script\src\WebJobs.Script\Description\FunctionLoader.cs : 0
at async Microsoft.Azure.WebJobs.Script.Description.DotNetFunctionInvoker.GetFunctionTargetAsync() at C:\projects\azure-webjobs-sdk-script\src\WebJobs.Script\Description\DotNet\DotNetFunctionInvoker.cs : 199
at async Microsoft.Azure.WebJobs.Script.Description.DotNetFunctionInvoker.InvokeCore(Object[] parameters,FunctionInvocationContext context) at C:\projects\azure-webjobs-sdk-script\src\WebJobs.Script\Description\DotNet\DotNetFunctionInvoker.cs : 270
at async Microsoft.Azure.WebJobs.Script.Description.FunctionInvokerBase.Invoke(Object[] parameters) at C:\projects\azure-webjobs-sdk-script\src\WebJobs.Script\Description\FunctionInvokerBase.cs : 90
at async Microsoft.Azure.WebJobs.Host.Executors.VoidTaskMethodInvoker`2.InvokeAsync[TReflected,TReturnType](TReflected instance,Object[] arguments)
at async Microsoft.Azure.WebJobs.Host.Executors.FunctionInvoker`2.InvokeAsync[TReflected,TReturnValue](Object instance,Object[] arguments)
at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.InvokeAsync(IFunctionInvoker invoker,ParameterHelper parameterHelper,CancellationTokenSource timeoutTokenSource,CancellationTokenSource functionCancellationTokenSource,Boolean throwOnTimeout,TimeSpan timerInterval,IFunctionInst…
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with the C# HTTP trigger, project.json, and SharePointPnPCoreOnline dependency described in the issue. Start with the complete function logs and the failure path at DotNetFunctionInvoker.cs:338; the issue's log is truncated and omits the compiler diagnostic. Done means identifying the compilation cause and documenting a verified resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.