You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-reference-csharp.md
+16-23Lines changed: 16 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -372,34 +372,27 @@ For information on how to upload files to your function folder, see the section
372
372
The directory that contains the function script file is automatically watched for changes to assemblies. To watch for assembly changes in other directories, add them to the `watchDirectories` list in [host.json](functions-host-json.md).
373
373
374
374
## Using NuGet packages
375
-
376
-
To use NuGet packages in a C# function, upload a *project.json* file to the function's folder in the function app's file system. Here is an example *project.json* file that adds a reference to Microsoft.ProjectOxford.Face version 1.1.0:
377
-
378
-
```json
379
-
{
380
-
"frameworks": {
381
-
"net46":{
382
-
"dependencies": {
383
-
"Microsoft.ProjectOxford.Face": "1.1.0"
384
-
}
385
-
}
386
-
}
387
-
}
375
+
To use NuGet packages in a C# function, upload a *extensions.csproj* file to the function's folder in the function app's file system. Here is an example *extensions.csproj* file that adds a reference to *Microsoft.ProjectOxford.Face* version *1.1.0*:
In Azure Functions 1.x, only the .NET Framework 4.6 is supported, so make sure that your *project.json* file specifies `net46` as shown here.
391
-
392
-
When you upload a *project.json* file, the runtime gets the packages and automatically adds references to the package assemblies. You don't need to add `#r "AssemblyName"` directives. To use the types defined in the NuGet packages; just add the required `using` statements to your *run.csx* file.
393
-
394
-
In the Functions runtime, NuGet restore works by comparing `project.json` and `project.lock.json`. If the date and time stamps of the files **do not** match, a NuGet restore runs and NuGet downloads updated packages. However, if the date and time stamps of the files **do** match, NuGet does not perform a restore. Therefore, `project.lock.json` should not be deployed, as it causes NuGet to skip package restore. To avoid deploying the lock file, add the `project.lock.json` to the `.gitignore` file.
395
-
396
389
To use a custom NuGet feed, specify the feed in a *Nuget.Config* file in the Function App root. For more information, see [Configuring NuGet behavior](/nuget/consume-packages/configuring-nuget-behavior).
397
390
398
-
### Using a project.json file
391
+
### Using a extensions.csproj file
399
392
400
393
1. Open the function in the Azure portal. The logs tab displays the package installation output.
401
-
2. To upload a project.json file, use one of the methods described in the [How to update function app files](functions-reference.md#fileupdate) in the Azure Functions developer reference topic.
402
-
3. After the *project.json* file is uploaded, you see output like the following example in your function's streaming log:
394
+
2. To upload a *extensions.csproj* file, use one of the methods described in the [How to update function app files](functions-reference.md#fileupdate) in the Azure Functions developer reference topic.
395
+
3. After the *extensions.csproj* file is uploaded, you see output like the following example in your function's streaming log:
403
396
404
397
```
405
398
2016-04-04T19:02:48.745 Restoring packages.
@@ -409,7 +402,7 @@ To use a custom NuGet feed, specify the feed in a *Nuget.Config* file in the Fun
0 commit comments