Ошибка an error occurred while writing

Steps to reproduce

Random
csproj nugets

	<ItemGroup>
		<PackageReference Include="AspNetCore.Authentication.ApiKey" Version="5.1.0" />
		<PackageReference Include="MediaTypeMap.Core" Version="2.3.3" />
		<PackageReference Include="NLog.Web.AspNetCore" Version="4.14.0" />
		<PackageReference Include="Npgsql" Version="5.0.12" />
		<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.10" />
		<PackageReference Include="RestSharp" Version="106.15.0" />
		<PackageReference Include="Blazorise.Bootstrap" Version="0.9.4.8" />
		<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.4.8" />
		<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.14" />
		<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
		<PackageReference Include="Services.Shared" Version="1.0.5.34" />
	</ItemGroup>

The issue

I Made an update to my Windows Service and since then some testers random gets this error.
But its usually gone after i restart the service manually there. (but cant do it on hundreds of customers)

Note my Npgsql Version is 5.0.12.0 and not 5.0.10.0
I Also tried removing logging.AddEventLog(); from ConfigureLogging(last lines of error log indicates it)
but it still happened.

ExceptionType: System.AggregateException
Message: An error occurred while writing to logger(s). (Could not load file or assembly 'Npgsql, Version=5.0.10.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7'. Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird. (0x80070020))

Stack: at Microsoft.Extensions.Logging.Logger.ThrowLoggingError(List`1 exceptions)
   at Microsoft.Extensions.Logging.Logger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter)
   at Microsoft.Extensions.Logging.Logger`1.Microsoft.Extensions.Logging.ILogger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter)
   at Microsoft.Extensions.Logging.LoggerExtensions.Log(ILogger logger, LogLevel logLevel, EventId eventId, Exception exception, String message, Object[] args)
   at Microsoft.Extensions.Logging.LoggerExtensions.LogError(ILogger logger, Exception exception, String message, Object[] args)
   at Services.Shared.Controllers.BaseController`1.ReturnError[TErrorType](Int32 errorType, Exception exception)
   at AbdataService.Controllers.Server.ServerController.ResetCaches() in C:buildagent_work45sAbdataServiceControllersServerServerController.cs:line 171
   at lambda_method85(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
----------------------------------------------------------------------

Inner Exception

ExceptionType: System.IO.FileLoadException
Message: Could not load file or assembly 'Npgsql, Version=5.0.10.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7'. Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird. (0x80070020)

Stack: at System.ModuleHandle.ResolveType(QCallModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
   at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
   at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
   at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(MetadataToken caCtorToken, MetadataImport& scope, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1& derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctorWithParameters, Boolean& isVarArg)
   at System.Reflection.CustomAttribute.IsCustomAttributeDefined(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Int32 attributeCtorToken, Boolean mustBeInheritable)
   at System.Reflection.CustomAttribute.IsDefined(RuntimeMethodInfo method, RuntimeType caType, Boolean inherit)
   at System.Diagnostics.StackTrace.ShowInStackTrace(MethodBase mb)
   at System.Diagnostics.StackTrace.ToString(TraceFormat traceFormat, StringBuilder sb)
   at System.Diagnostics.StackTrace.ToString(TraceFormat traceFormat)
   at System.Exception.get_StackTrace()
   at System.IO.FileLoadException.ToString()
   at System.Text.StringBuilder.Append(Object value)
   at Microsoft.Extensions.Logging.EventLog.EventLogLogger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter)
   at Microsoft.Extensions.Logging.Logger.<Log>g__LoggerLog|12_0[TState](LogLevel logLevel, EventId eventId, ILogger logger, Exception exception, Func`3 formatter, List`1& exceptions, TState& state)
Exception message:
Stack trace:

Further technical details

Npgsql version:
Npgsql Version 5.0.12
Npgsql.EntityFrameworkCore.PostgreSQL Version 5.0.10
PostgreSQL version: PostgreSQL 10.4, compiled by Visual C++ build 1800, 64-bit
Operating system: windows 10

Other details about my project setup:

Windows 10: An error occurred while writing installation information to disk. Check to make sure enough…

Discus and support An error occurred while writing installation information to disk. Check to make sure enough… in Windows 10 BSOD Crashes and Debugging to solve the problem; The error occurs during the installation of applications with the extension .msi

What should I do in this situation…
Discussion in ‘Windows 10 BSOD Crashes and Debugging’ started by tvoybossofficial, Jan 3, 2020.

  1. An error occurred while writing installation information to disk. Check to make sure enough…

    The error occurs during the installation of applications with the extension .msi

    What should I do in this situation

    :)

  2. Disk write error problem.

    Got it, Darius. The most common cause of getting a disk write error is having bad sectors on the hard drive. It’s also possible that your disk is write protected and have set specific permissions. To help sort out the issue, please run or install the program
    or software in compatibility mode. Follow these steps:

    • Right-click the EXE file or the program’s shortcut and select Properties.
    • Select the Compatibility tab.
    • Under Compatibility mode, tick the box for Run this program in compatibility mode and select the appropriate operating system or the version of Windows you want to use.
    • Click Apply, then OK.

    Check out
    Make older programs compatible with this version of Windows for more information.

    If the issue persists, please send us a screenshot of the error message so we can further check on it.

    Looking forward to hear from you.

    Regards.

  3. «A Disk Read Error Occurred»

    I tried to install windows 2000, and after i do a format, and after it copies the files, it says the computer must be restarted, but after it restarts, i get a message that says:

    «A Disk Read Error Occurred»

    Do i have to hit f6 and install something?
    i do have SATA.

  4. An error occurred while writing installation information to disk. Check to make sure enough…

    The Disk Is Write Protected — How To Remove Write Protection

    Hi Fernanda,

    Thank you for writing to Microsoft Community Forums.

    In regards to your concern, please help me with following questions:

    • Is the Hard drive external or internal?

    You can try following steps and check if that fixes the issue:

    1. Run Virus scan on the Hard Drive.
    2. Perform check disk commands on the Hard Disk to fix the Disk errors.

    Refer to this article.

    Note: Remove all the external devices before performing check disk.

    Data Loss Disclaimer:

    While performing these steps there might be a risk of data loss. You may take a backup of the data before performing the steps.

    Hope it helps.

    Let us know if you got the help you needed by clicking Yes or No.

    Rohit Raina

    Microsoft Community — Moderator

Thema:

An error occurred while writing installation information to disk. Check to make sure enough…

  1. An error occurred while writing installation information to disk. Check to make sure enough… — Similar Threads — error occurred while

  2. Migrant Assistant Error Message — “An error occurred while preparing your information for…

    in Windows 10 Gaming

    Migrant Assistant Error Message — “An error occurred while preparing your information for…: Hi,I am very frustrated. I’ve tried everything and I seriously need help. Anything is appreciated. I’m attempting to transfer my data from my Microsoft Windows 10 computer to a Mac OS Monetary computer, but every time I try and even open the application on my Windows computer…
  3. Migrant Assistant Error Message — “An error occurred while preparing your information for…

    in Windows 10 Software and Apps

    Migrant Assistant Error Message — “An error occurred while preparing your information for…: Hi,I am very frustrated. I’ve tried everything and I seriously need help. Anything is appreciated. I’m attempting to transfer my data from my Microsoft Windows 10 computer to a Mac OS Monetary computer, but every time I try and even open the application on my Windows computer…
  4. Migrant Assistant Error Message — “An error occurred while preparing your information for…

    in Windows 10 Drivers and Hardware

    Migrant Assistant Error Message — “An error occurred while preparing your information for…: Hi,I am very frustrated. I’ve tried everything and I seriously need help. Anything is appreciated. I’m attempting to transfer my data from my Microsoft Windows 10 computer to a Mac OS Monetary computer, but every time I try and even open the application on my Windows computer…
  5. Error is occuring while installing window 11

    in Windows 10 Software and Apps

    Error is occuring while installing window 11: Hello, I am Huzaifa from Newyork. I am facing some problems in whichThe same error is occurring to me while installing Windows 11.I have access to several TB of storage. I possess several internal HD. «Chkdsk cannot run because the volume is in use by another process,» says…
  6. An error occurred while writing installation information to disk

    in Windows 10 BSOD Crashes and Debugging

    An error occurred while writing installation information to disk: Hello all, all of a sudden I started getting getting the above error message regardless if I am trying to install or uninstall a program. Its been driving me crazy, my hard drive is 1TB with 800GB Free space. I looked everywhere without success. Any help is greatly appreciate…
  7. Is running chkdsk enough to make sure data is not corrupted?

    in Windows 10 Network and Sharing

    Is running chkdsk enough to make sure data is not corrupted?: I have a Seagate 500GB USB HDD…I was downloading a file with google chrome into the drive and then suddenly my system crashed…I restarted the system and ran the following tests on the disk:

    1 chkdsk G: /r

    2 Seatools Short Drive Self Test.

    3 Seatools Short Generic test….

  8. An error occurred while ejecting ‘Removeable Disk E’

    in Windows 10 Drivers and Hardware

    An error occurred while ejecting ‘Removeable Disk E’: I have an HP Pavilion dv7 and my optical disk DVD drive will no longer eject when I select the ‘eject’ function from the pop-up menu. When I select ‘eject’, I get the error message listed in the subject line. I’ve uninstalled the IDE ATA/ATAPI controllers and the DVD device…
  9. While windows installing, a unexpected error occur

    in Windows 10 Installation and Upgrade

    While windows installing, a unexpected error occur: I reinstalled the windows. When I try to install it, it say there are some unexpected error occur and my install is fail. I try reinstall like 10 times but it fails. What can I do?[IMG]…
  10. Error occurs while installing updates

    in Windows 10 Installation and Upgrade

    Error occurs while installing updates: • Feature update to Windows 10, version 1803 — Error 0x8007007e

    • Update for Windows 10 Version 1607 for x64-based Systems (KB4033631) — Error 0x8000ffff

    • Update for Windows 10 Version 1607 for x64-based Systems (KB4049411) — Error 0x8000ffff

    • Update for Windows 10…

Users found this page by searching for:

  1. an error occurred while writing installation

    ,

  2. an error occurred while writing installation information to disk

    ,

  3. an error occured while writing instalation to disk

    ,

  4. .msi installer error occurred while writing installation information to disk. check to make sure enough disk space is available,
  5. an error occurred writing installation information to disk,
  6. an error has occured while writing installation information ot the disk,
  7. an error occurred whilst writing installation information to disk,
  8. an error occurred while writing installation epicstore,
  9. error occured when writing installation information to disk,
  10. an error occured while writing installation information to the disk,
  11. windows 10 an error occurred while writing installation information to disk,
  12. an error occurred while writing installation information to,
  13. wrroenoccured while writing installation information to disk windows 10,
  14. an-error-occurred-while-writing windows 10,
  15. an error occured when writing information to ndisk


Windows 10 Forums

I am getting a random exception for a web API hosted in an App Service in Azure. I don’t see this is a problem related to my code. Here is the error message and stack trace from Application Insights:

Message An error occurred while writing to logger(s). (The process cannot access the file because it is being used by another process) The process cannot access the file because it is being used by another pr…[show more]    
Exception type  System.ComponentModel.Win32Exception    
Failed method   System.Diagnostics.EventLogInternal.InternalWriteEvent

With the following stack trace:

System.AggregateException:
   at Microsoft.Extensions.Logging.Logger.Log (Microsoft.Extensions.Logging, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.Extensions.Logging.Logger`1.Microsoft.Extensions.Logging.ILogger.Log (Microsoft.Extensions.Logging.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.Extensions.Logging.LoggerMessage+<>c__DisplayClass6_0`2.<Define>b__0 (Microsoft.Extensions.Logging.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNetCore.Mvc.Internal.MvcCoreLoggerExtensions.ActionMethodExecuting (Microsoft.AspNetCore.Mvc.Core, Version=2.2.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker+<InvokeActionMethodAsync>d__12.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=2.2.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker+<InvokeNextActionFilterAsync>d__10.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=2.2.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow (Microsoft.AspNetCore.Mvc.Core, Version=2.2.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next (Microsoft.AspNetCore.Mvc.Core, Version=2.2.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker+<InvokeInnerFilterAsync>d__13.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=2.2.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeNextResourceFilter>d__23.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=2.2.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow (Microsoft.AspNetCore.Mvc.Core, Version=2.2.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next (Microsoft.AspNetCore.Mvc.Core, Version=2.2.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeFilterPipelineAsync>d__18.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=2.2.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeAsync>d__16.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=2.2.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Builder.RouterMiddleware+<Invoke>d__4.MoveNext (Microsoft.AspNetCore.Routing, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware+<Invoke>d__6.MoveNext (Microsoft.AspNetCore.Authentication, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT`1+<ProcessRequestAsync>d__2.MoveNext (Microsoft.AspNetCore.Server.IIS, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
Inner exception System.ComponentModel.Win32Exception handled at Microsoft.Extensions.Logging.Logger.Log:
   at System.Diagnostics.EventLogInternal.InternalWriteEvent (System.Diagnostics.EventLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
   at System.Diagnostics.EventLogInternal.WriteEvent (System.Diagnostics.EventLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
   at Microsoft.Extensions.Logging.EventLog.WindowsEventLog.WriteEntry (Microsoft.Extensions.Logging.EventLog, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.Extensions.Logging.EventLog.EventLogLogger.WriteMessage (Microsoft.Extensions.Logging.EventLog, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.Extensions.Logging.EventLog.EventLogLogger.Log (Microsoft.Extensions.Logging.EventLog, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.Extensions.Logging.Logger.Log (Microsoft.Extensions.Logging, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)

This is my Program.cs:

public class Program
{
    public static void Main(string[] args)
    {
        CreateWebHostBuilder(args).Build().Run();
    }

    public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
        WebHost.CreateDefaultBuilder(args)
            .UseStartup<Startup>()
            .UseApplicationInsights()
            .ConfigureLogging(logging =>
            {
                logging.ClearProviders();
                logging.SetMinimumLevel(LogLevel.Information);
                logging.AddEventSourceLogger();
                logging.AddEventLog();
            });
}

and appsettings:

{
  "Logging": {
    "LogLevel": {
      "Default": "Debug",
      "System": "Information",
      "Microsoft": "Information"
    }
  }
}

Any help with the idea when it happens or might happen would be beneficial.

  • Remove From My Forums
  • Question

  • User1951347727 posted

    I am attempting to install «rewrite_amd64.msi» on a Windows 2012 R2 virtual machine that is running on AWS.

    The installation fails with the error noted below.  The server has sufficient disk space (28.8 GB free on C Drive, 57.9 GB free on d drive).

    Any ideas?

    Action 6:21:43: GenerateScript. Generating script operations for action:
    GenerateScript: CheckForSharedConfiguration
    Error 1711. An error occurred while writing installation information to disk. Check to make sure enough disk space is available, and click Retry, or Cancel to end the install.
    MSI (s) (80:48) [06:21:46:958]: Product: IIS URL Rewrite Module 2 — Error 1711. An error occurred while writing installation information to disk. Check to make sure enough disk space is available, and click Retry, or Cancel to end the install.

Answers

  • User-460007017 posted

    Hi Euches,

    It looks like a micosoft installer problem instead of a URL rewrite feature problem.

    Please try the following steps:

    Step 1: Unregister and then reregister Windows Installer

             1. Unregister Windows Installer. To do this, click Start, type run, click Run, type msiexec /unregister  in the Open box, and then click OK.

             2. Reregister Windows Installer. To do this, click Start, type run, click Run, type msiexec /regserver in the Open box, and then click OK.

    Step 2: Deleting temporary files

    Try to delete the temp file in:

    «C:Users{user name}AppDataLocalTemp» or «%userprofile%appdatalocaltemp»

    Best Regards,

    Yuk Ding

    • Marked as answer by

      Tuesday, September 28, 2021 12:00 AM

I have an application that was experiencing the same issues writing to the EventLogger in our .NET Core 3.1.0 Web API application running in Azure. We are using the built in ILogger<> along with NLog to persist logs to Stackify and Raygun.

Our application used the MediatR library and we wrapped our pipeline execution with additional logging such that every time a different command executed, we’d log how long it took. Our application used logging extensively. Most of these issues occurred when we had a significant increase in user activity.

These errors would show up in our logging in the form of an AggregateException:

An error occurred while writing to logger(s). (The process cannot access the file because it is being used by another process.)

With an Inner Exception:

System.Diagnostics.EventLogInternal.InternalWriteEvent(UInt32 eventID, UInt16 category, EventLogEntryType type, String[] strings, Byte[] rawData, String currentMachineName)
System.Diagnostics.EventLogInternal.WriteEvent(EventInstance instance, Byte[] data, Object[] values):170
Microsoft.Extensions.Logging.EventLog.WindowsEventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category):129
Microsoft.Extensions.Logging.EventLog.EventLogLogger.WriteMessage(String message, EventLogEntryType eventLogEntryType, Int32 eventId):158
Microsoft.Extensions.Logging.EventLog.EventLogLogger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func3 formatter)
Microsoft.Extensions.Logging.Logger.<Log>g__LoggerLog|12_0[TState](LogLevel logLevel, EventId eventId, ILogger logger, Exception exception, Func3 formatter, List1& exceptions, TState& state):45

We’d essentially see hundreds of these errors and it would cause our application to become unresponsive and timeout requests. But—our application does not need EventSource logging, so we took the recommendation of @Dan Kroymann and removed the EventLog from the logging providers configured in Progam.cs, e.g.,

public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
            .ConfigureLogging((hostingContext, logging) =>
            {
                logging.ClearProviders();
                logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
                logging.AddDebug();
                logging.AddConsole();
            })
            .ConfigureWebHostDefaults(webBuilder => webBuilder
                .UseStartup<Startup>()
                .UseNLog());

You may need to reference additional nuget packages in order to use some of the logging extension methods:

Microsoft.Extensions.Logging

Microsoft.Extensions.Logging.Console

Microsoft.Extensions.Logging.Debug

Once we put the above fix in place, we stopped seeing EventSource logging issues.

Понравилась статья? Поделить с друзьями:
  • Ошибка an error occurred while sending the request
  • Ошибка access violation at address 00408e8f in module
  • Ошибка access violation at address 00000000 read
  • Ошибка access violation at address 00000
  • Ошибка access violation 0xc0000005 in module