GCDEV
(GCDEV)
October 7, 2020, 3:12pm
1
Hallo zusammen!
Bisher haben wir LL nur in einem Windows Dienst eingesetzt.
Nun wollten wir den Teil Richtung IIS verlagern.
Windows 2019 Datacenter, IIS 10, VB .NET 4.8
LL 25.2020.11608
Nach dem Exportieren eines PDFs werden jedoch einige DLLs im WWW Verzeichnis (/bin) von w3wp blockiert. Die Dateien lassen sich nur löschen, wenn der IIS Prozess beendet wird.
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 07.10.2020 16:38 3812840 cxBR25.dll
-a---- 07.10.2020 16:38 3806696 cxCT25.dll
-a---- 07.10.2020 16:38 2130408 cxDW25.dll
-a---- 07.10.2020 16:38 27833320 cxLL25.dll
-a---- 07.10.2020 16:38 2449896 cxLL2501.lng
-a---- 07.10.2020 16:38 4115944 cxLL25bc.llx
-a---- 07.10.2020 16:38 14992360 cxLL25ex.llx
-a---- 07.10.2020 16:38 12883952 cxLL25ht.llx
-a---- 07.10.2020 16:38 10067944 cxll25oc.llx
-a---- 07.10.2020 16:38 11349480 cxLL25pr.dll
-a---- 07.10.2020 16:38 8979232 cxll25pw.llx
-a---- 07.10.2020 16:38 15687512 cxLL25xl.dll
-a---- 07.10.2020 16:38 5770728 cxLS25.dll
-a---- 07.10.2020 16:38 2764776 cxUT25.dll
Warum ist das so?
Wie können wir das umgehen?
Den IIS Pool neuzustarten ist keine Lösung.
Leider blockieren diese DLLs nun das Deployment…
Vielen Dank!
Alles war wir mit LL machen ist folgendes:
LL = New ListLabel
LL.LicensingInfo = ...
LL.AutoShowSelectFile = False
LL.AutoShowPrintOptions = False
LL.AutoDestination = LlPrintMode.Export
LL.SetDataBinding(dsEtiketten, String.Empty)
LL.AutoProjectType = LlProject.Label
LL.AutoProjectFile = strTemplateFile
//LL.Debug = LlDebug.Enabled
LL.ExportOptions.Add("Export.Target", "PDF")
LL.ExportOptions.Add("Export.File", strPDF)
LL.ExportOptions.Add("Export.Path", strPathPdf)
LL.ExportOptions.Add("Export.Quiet", "1")
pd = New Printing.PrintDocument()
strDruckername = pd.PrinterSettings.PrinterName
settings = New Printing.PrinterSettings()
strDruckername = settings.PrinterName
LL.Core.LlSetPrinterInPrinterFile(LlProject.List, strTemplateFile, LlPrinterIndex.AllPages, strDruckername)
LL.Print()
pd.Dispose()
LL.Core.Dispose()
LL.Dispose()
Da der worker process bzw. der IIS die nativen DLLs lockt, muss zumindest der AppPool recyceled werden. Vergleichen Sie dazu auch folgende Links:
Visual Studio Feedback
https://faithlife.codes/blog/2013/05/using-native-dlls-from-asp-net-apps/
opened 10:20AM - 21 Apr 17 UTC
closed 02:25PM - 18 Dec 19 UTC
kind/bug
lang/C#
platform/Windows
priority/P3
disposition/stale
Re-posting an issue reported by @ivannaranjo from e-mail thread.
_I am trying… to re-deploy apps that contain gRPC API clients on them, such as the StackDriver logging, I am seeing problems where the native .dll is in use and cannot be deleted. Because the deployment of an ASP.NET 4.x app (https://www.asp.net/) to a Windows VM requires the replacement of all files, if a file cannot be deleted that blocks the deployment.
The user can unblock themselves by shutting IIS down and deleting the files by hand, but that seems a bit too drastic. Have you seen anything like this previously? Any ideas here? Is it just something that comes from having a native (i.e. non C#) .dll loaded in the AppDomain?
Here's the interesting tidbit from the deployment log that shows the failure, the error is a bit misleading because it shows insufficient privileges, really is that file is in use._
```
msdeploy.exe -verb:sync -source:contentPath="C:\Users\ivann\AppData\Local\Temp\2\5ml0urec.0w2" -dest:contentPath="Default Web Site",publishSettings="C:\Users\ivann\AppData\Local\Temp\2\tmp2A6B.tmp" -allowUntrusted
Info: Using ID 'b64e9ea2-383a-4483-97e1-d3cb82dc98e4' for connections to the remote server.
Info: Deleting file (Default Web Site\bin\grpc_csharp_ext.x64.dll).
Error Code: ERROR_INSUFFICIENT_ACCESS_TO_SITE_FOLDER
More Information: Unable to perform the operation ("Delete File") for the specified directory ("C:\inetpub\wwwroot\bin\grpc_csharp_ext.x64.dll"). This can occur if the server administrator has not authorized this operation for the user credentials you are using. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_INSUFFICIENT_ACCESS_TO_SITE_FOLDER.
Error: The error code was 0x80070005.
Error: Access to the path 'C:\inetpub\wwwroot\bin\grpc_csharp_ext.x64.dll' is denied.
at Microsoft.Web.Deployment.NativeMethods.RaiseIOExceptionFromErrorCode(Win32ErrorCode errorCode, String maybeFullPath)
at Microsoft.Web.Deployment.FileEx.Delete(String path)
at Microsoft.Web.Deployment.FilePathProviderBase.Delete(Boolean whatIf)
Error count: 1.
Failed to publish project AspNetClassic.
```
Bei Verwendung des WebDeploys mit einer App_Offline.htm sollte dies auch geschehen. Die folgenden beiden Links beschreiben das: