3
votes

I tried to install NuGet package for Azure Function in project.json as follow:

{
  "frameworks": {
    "net46":{
      "dependencies": {
        "PDFNet": "6.7.1",
        "PDFNetNoLoader": "6.5.4"
      }
    }
  }
}

However, I get this error message "Access to the path '________' is denied" for every package I tried to install. The path _______ is different each time packages are restored.

2017-01-06T15:38:53.804 Restoring packages for D:\home\site\wwwroot\PDFT\project.json...
2017-01-06T15:38:54.153 CACHE https://api.nuget.org/v3-flatcontainer/pdfnet/index.json
2017-01-06T15:38:54.184 CACHE https://api.nuget.org/v3-flatcontainer/pdfnet/6.7.1.52203/pdfnet.6.7.1.52203.nupkg
2017-01-06T15:38:54.262 CACHE https://api.nuget.org/v3-flatcontainer/pdfnetnoloader/index.json
2017-01-06T15:38:54.262 CACHE https://api.nuget.org/v3-flatcontainer/pdfnetnoloader/6.5.4/pdfnetnoloader.6.5.4.nupkg
2017-01-06T15:38:54.387 Installing PDFNetNoLoader 6.5.4.
2017-01-06T15:38:54.496 Access to the path 'ofvjs2t3.tlt' is denied.
2017-01-06T15:38:54.496 
2017-01-06T15:38:54.496 
2017-01-06T15:38:53.032 Restoring packages for D:\home\site\wwwroot\PDFT\project.json...
2017-01-06T15:38:54.261 CACHE https://api.nuget.org/v3-flatcontainer/pdfnet/index.json
2017-01-06T15:38:54.291 CACHE https://api.nuget.org/v3-flatcontainer/pdfnet/6.7.1.52203/pdfnet.6.7.1.52203.nupkg
2017-01-06T15:38:56.391 Access to the path 'ofvjs2t3.tlt' is denied.
2017-01-06T15:38:56.406 
2017-01-06T15:38:56.406 
2017-01-06T15:38:56.736 Access to the path 'ofvjs2t3.tlt' is denied.
2017-01-06T15:38:56.812 
2017-01-06T15:38:56.812 
2017-01-06T15:38:56.255 
2017-01-06T15:38:56.255 
2017-01-06T15:38:55.678 
2017-01-06T15:38:55.678 
2017-01-06T15:38:56.563 
2017-01-06T15:39:30.355 Could not find file 'D:\home\data\Functions\packages\nuget\pdfnetnoloader\6.5.4\ofvjs2t3.tlt'.
2017-01-06T15:39:30.389 
2017-01-06T15:39:30.389 
2017-01-06T15:39:30.636 Installing PDFNetNoLoader 6.5.4.

What could be the problem here?

EDIT I messed up a lot with the function app so I created a new function app to try the whole thing again. This time the packages are installed successfully and I can see assemblies in packages folders via Kudu.

I still get an exception when running the code about assemblies not found, but I think this is the problem specific to this package.

1
I wonder if the failures occur only for the PDF packages. Can you try adding a dependency to some other package, like AutoMapper, for instance?Don Lockhart
@DonLockhart I tried NewtonSoft.Json and got the same problemMind
This is indeed strange. Are you having the same issue with all functions in the same Function App?Fabio Cavalcante
Can you open Kudu (https//<yourappname>.scm.azurewebsites.net), open the diagnostic console, navigate to the package cache folder (D:\home\data\Functions\packages\nuget) delete the folders for those packages and try again? If that is the only function in your app, you can delete the entire nuget folder and retry.Fabio Cavalcante
@Mind What runtime version is it on? I wonder if there's an issue with preview released previous to "latest (~1)"??... It works for me just fine with an Azure Function on latest runtime version.Chris Pietschmann

1 Answers

0
votes

Check if Read Only flag is set on those D: folders which it is trying to access. If yes, remove it and try again.