Azure Functions, nuget package installation failed - azure

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.

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

Related

An assembly specified in the application dependencies manifest was not found

So I have a .NET Core 2.2 web application.
I added the EPPlus library to it and now, when it is released to Azure (App Service) it won't start and I get the error:
HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure
I narrowed this down by running a console in Azure and the command: "dotnet my.project.dll" - and got the actual error:
An assembly specified in the application dependencies manifest
(my.project.deps.json) was not found:
package: 'Microsoft.Win32.SystemEvents', version: '4.5.0'
path: 'runtimes/win/lib/netcoreapp2.0/Microsoft.Win32.SystemEvents.dll'
The Microsoft.Win32.SystemEvents.dll is present in the main wwwroot folder the application is deployed to.
But the whole runtimes/win/libs/ folder I don't think exists at all.
The my.project.deps.json files has the section which looks like this:
"Microsoft.Win32.SystemEvents/4.5.0": {
"dependencies": {
"Microsoft.NETCore.Platforms": "2.2.0"
},
"runtime": {
"lib/netstandard2.0/Microsoft.Win32.SystemEvents.dll": {
"assemblyVersion": "4.0.0.0",
"fileVersion": "4.6.26515.6"
}
},
"runtimeTargets": {
"runtimes/win/lib/netcoreapp2.0/Microsoft.Win32.SystemEvents.dll": {
"rid": "win",
"assetType": "runtime",
"assemblyVersion": "4.0.0.0",
"fileVersion": "4.6.26515.6"
}
}
}
If I delete the whole "runtimeTargets" section, then the application works! (Well, I have to do the same for a few more dll's too: System.Drawing.Common and System.Security.Cryptography.Pkcs)
But the file gets regenerated fully whenever it is published and released - so it is not a viable solution.
I also don't know what that section of the file does. It might be important to leave it in. Though it all works so it can't be that vital...
It is built and published through TeamCity - I'm not an expert on the process but I think the command being run amounts to this:
dotnet publish my.proj.csproj --configuration RELEASE --no-restore --no-build
Other things tried: < PublishWithAspNetCoreTargetManifest>false< / PublishWithAspNetCoreTargetManifest>
had no effect
Anyone have any ideas?
As it turns out, it was my fault :(
Team City was created a NuGet package from the published output. But the /runtimes folder was not included in the package so was never released as part of the site.
I edited the nuspec file to include it /runtimes and all works OK.
I've had same issue. After the build I copied all files to the "production" directory by DOS command copy so then the files from "runtimes" subfolder were missing. Copying all files including all subdirectories (by using xcopy) fixed the issue.

ASP.NET Core fails to run under IIS: HTTP Error 500.0 - ANCM In-Process Handler Load Failure

I just upgraded my web application from ASP.NET (Framework) MVC to ASP.NET Core 2.2. The application runs fine under IIS Express, however as soon as I try to run it under IIS it gives the generic error:
HTTP Error 500.0 - ANCM In-Process Handler Load Failure Common causes
of this issue: The specified version of Microsoft.NetCore.App or
Microsoft.AspNetCore.App was not found. The in process request
handler, Microsoft.AspNetCore.Server.IIS, was not referenced in the
application. ANCM could not find dotnet.
I've searched the web and see that many developers are running into the same issue, it seems that Microsoft really missed the mark on this one and have made it as painful as possible to develop ASP.NET Core apps under IIS. Regardless, I'd like to break through this brick wall that I've been hitting my head against for the last 24 hours, so could use some help.
Things I've tried so far:
Installed the latest version of .NET Core Runtime and Hosting Bundle, version 2.2.4.
Installed the latest version of .NET Core SDK, version 2.2.203.
Ensured that "dotnet" is runnable from command line, and that the x64 version is before the x86 version in my environment variables.
C:\WINDOWS\system32>where dotnet C:\Program Files\dotnet\dotnet.exe
C:\Program Files (x86)\dotnet\dotnet.exe
Tried changing my auto-generated Web.config from aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" to aspNetCore processPath="dotnet" arguments="./Housters.Web.dll" however the changes don't stick, every time I build my web application the Web.config gets reverted back tot he original %LAUNCHER_PATH% values.
Tried changing "AspNetCoreModuleV2" to "AspNetCoreModule" in the Web.config.
Added IsTransformWebConfigDisabled=true to my Web.csproj file in order to keep my custom Web.config from being overwritten. It didn't work, the Web.config is still overwritten.
Tried switching AspNetCoreHostingModel=InProcess to RuntimeFrameworkName=Microsoft.AspNetCore.App in my Web.csproj file.
Cleaning the solution, as well as manually deleting the bin, obj, and even .vs folders.
None of these methods helped, I still get the same ANCM In-Process Handler Load Failure error. The Event Viewer does show a more useful error:
Application 'C:\Housters\Web\' wasn't able to start. Executable was
not found at 'C:\Housters\Web\%LAUNCHER_PATH%.exe'
However, I can't do anything about that because my Web.config changes don't persist. But really, the default settings should work out of the box, we shouldn't have to jump through hoops to get IIS development working. Why is it looking for an .exe when an ASP.NET Core project by default only generates a .dll? And why isn't it replacing %LAUNCHER_PATH% with the correct path, e.g. "bin/Debug"?
EDIT: I should also mention that at times I've been able to get my custom Web.config to persist, and when I do then every time I try to run the web application I get a JIT debugger prompt:
Choosing to debug, or viewing the event log just gives me a really unfriendly error message:
Faulting application name: w3wp.exe, version: 10.0.17134.1, time
stamp: 0xed729d4e Faulting module name: KERNELBASE.dll, version:
10.0.17134.556, time stamp: 0xb9f4a0f1 Exception code: 0xc0020001 Fault offset: 0x000000000003a388 Faulting process id: 0x2650 Faulting
application start time: 0x01d502b1f21b112e Faulting application path:
c:\windows\system32\inetsrv\w3wp.exe Faulting module path:
C:\WINDOWS\System32\KERNELBASE.dll Report Id:
5b5c14cb-8ffa-47b4-8cc1-42f951bc1256 Faulting package full name:
Faulting package-relative application ID:
You're getting this error because you're not specifying if you want the website hosted in process or out of process... in process can be specified by using UseIIS().
Try changing your CreateWebHostBuilder method in Program.cs to:
public static IWebHostBuilder CreateWebHostBuilder(string[] args)
{
var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
var builder = WebHost.CreateDefaultBuilder(args);
if (env == EnvironmentName.Staging || env == EnvironmentName.Production)
builder.UseIIS();
builder.UseStartup<Startup>();
return builder;
}
I set ASPNETCORE_ENVIRONMENT in my .pubxml deployment profile by adding:
<PropertyGroup>
<EnvironmentName>Staging</EnvironmentName>
</PropertyGroup>
The cause of this error may also be because the version of the .NET SDK which is in the global.json file of your application is not installed on your local machine. The solution is to check which version is configured in the global.json file and install it on your machine. I managed to solve this error this way (01/06/2022).
The following error will appear in the Windows Event View:
I solve this error just by changing in the web.config AspNetCoreModuleV2 to AspNetCoreModule, but this is not perfect solution.
Another solution is deploying application as Self-Contained when you will publish it.

Nodejs fs.copyfile not allowed for copy a file to the destination folder

I am trying to copy a file from one location to another so I'm using this:
fs.copyFile('C:\\Users\\Me\\Documents\\myfile.zip', c:\\myfiles
console.log('file was copied successfully!');
});
I can see that the destination folder is readonly so that's why I'm getting this.
How can I change it's status on my windows pc.
I've tried this but nothing is happening and I still get the error:
fs.chmodSync('c:\\myfiles', 0o755);
How can I fix this issue?
You are using Windows, I guest C:\ is your system disk (where you install the Windows).
If you want to write a file to c:\myfiles , it require you Administrator permission (you can try by way: copy and paste a file to the folder, by hand).
Solution:
Option1: Change your folder, ex: D:\myfiles
Option2: Use windows file manager, change your folder permission (everyone read/write)

opkg-cl update 2 download error

Am trying to update using opkg-cl. Getting the following errors. Does anyone know how I go about troubleshooting this?
[root#wrap /root]$ /etc/opkg/opkg_update.sh
Downloading /Packages.gz.
Downloading file:///mnt/usb/packages/Packages.gz.
Downloading https://beacon-repo.shoppertrak.com/repos/stable/Packages.gz.
Inflating https://beacon-repo.shoppertrak.com/repos/stable/Packages.gz.
Updated list of available packages in /var/lib/opkg/lists/all-remote-shoppertrak.
Downloading https://beacon-repo.shoppertrak.com/repos/base/Packages.gz.
Inflating https://beacon-repo.shoppertrak.com/repos/base/Packages.gz.
Updated list of available packages in /var/lib/opkg/lists/all-remote-base.
Collected errors:
* opkg_download: Failed to download /Packages.gz: URL using bad/illegal format or missing URL.
* copy_file: ///mnt/usb/packages/Packages.gz: No such file or directory.
* file_copy: Failed to copy file ///mnt/usb/packages/Packages.gz to /tmp/opkg-8FAiHb/update-iCH5Eo/all-local.gz.
[root#wrap /root]$ ls /mnt/usb/
[root#wrap /root]$
[root#wrap /root]$
Could you provide more information on your configuration?
Such as:
opkg version
content of your opkg feeds config file /etc/opkg/*.conf)
At first glance it looks like you have a local feed configured at file:///mnt/usb/packages/, which is lacking a Package.gz file.

unable to run locally orchard azure project ysod fresh off sources

I am trying to run locally Orchard.Azure.CloudService project without any code changes to the official stable release 1.7.1 (58c21815). full source address is # https://git01.codeplex.com/orchard .
Here is the steps to reproduce the error:
launch the Orchard.Azure solution
select "Debug" build
click on press F5 start debugging
the page will show "Server Error in '/' Application."
None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Orchard.Environment.DefaultOrchardShell' can be invoked with the available services and parameters: Cannot resolve parameter 'Orchard.Mvc.Routes.IRoutePublisher routePublisher' of constructor 'Void .ctor(System.Func1[Autofac.Features.OwnedInstances.Owned1[Orchard.Environment.IOrchardShellEvents]], System.Collections.Generic.IEnumerable1[Orchard.Mvc.Routes.IRouteProvider], System.Collections.Generic.IEnumerable1[Orchard.WebApi.Routes.IHttpRouteProvider], Orchard.Mvc.Routes.IRoutePublisher, System.Collections.Generic.IEnumerable`1[Orchard.Mvc.ModelBinders.IModelBinderProvider], Orchard.Mvc.ModelBinders.IModelBinderPublisher, Orchard.Tasks.ISweepGenerator)'.
Source Error:
Line 111: var shellScope = _shellContainerFactory.CreateContainer(settings, blueprint);
Line 112:
Line 113: return new ShellContext {
Line 114: Settings = settings,
Line 115: Descriptor = descriptor,
Source File: c:\projects\orchard\src\Orchard\Environment\ShellBuilders\ShellContextFactory.cs Line: 113
`
... "
Windows 8, x64
VS2012.3 Azure SDK 2.1
source code version hash: 58c21815
It is a known issue that the solution can't run in the emulator. This is caused by the structure of the solution, and the fact the emulator doesn't run the cspack file. This script is used to copy modules and themes into the package for Azure deployment. When the emulator runs it simply mounts the Orchard.Azure.Web project which is almost empty and doesn't have all the files necessary to run the solution.
See this discussion on CodePlex for more detail.
I don't believe you should be running that solution but the main Orchard solution.
ie, you don't need to develop specifically for Azure, just deploy for Azure.
I think ^_^

Resources