none
Why is there an access denied error only on latest publishing of software? RRS feed

  • Question

  • I seek wisdom from the Jedi Counsel, I mean Microsoft technical support and developers.

    We have published many times to a Windows 2012 Server and it has always worked however upon publishing almost the exact code there is an access denied error in a module that wasn't there before.

    The error comes from Log4Net not being able to access a folder on disk.

    The error takes the path entered and replaces all backslashes "\\" with underscore "_" and nothing has changed in the logger for several versions.

    When run locally or in azure for other clients it works and no access denied error is given.

    When down grading the same client with the same version of the logger no exception exists.

    The Web config points to the same folder it always has and the user is the AppPool user which is the same as it always was.

    I was thinking that maybe the client gave the folder special permissions or something recently, but when I inquired he said no.

    What do you believe is the problem?

    Wednesday, October 24, 2018 7:44 AM

Answers

  • Hi Probanx Lead Developer,

    This forum discusses and asks questions about the C# programming language, since your issue is more related to log4net that is a third-party component, I would suggest that you could post your issue on stackoverflow with tag log4net & C# for suitable support.

    https://stackoverflow.com/questions/tagged/log4net

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, October 25, 2018 3:18 AM

All replies

  • Hi,

    is the directory already created? I had a similair problem where a subdirectory was not created. How is your log4net configured? Which appenders are you using?

    "The error takes the path entered and replaces all backslashes "\\" with underscore "_" and nothing has changed in the logger for several versions."

    What do you mean by that? "...error takes the path..." 

    Greetings, Chris

    Wednesday, October 24, 2018 8:04 AM
  • When it echoes the Access Denied error: it shows the path as C__Temp_Logs for example.

    However the path loaded is correct.

    The directory is already there.

    The appender is RollingFileAppender. It works and has worked until this version which changed nothing to do with the Logger. The previous version with the same configuration has no exception with the same AppPool user and the same path.

     

    Wednesday, October 24, 2018 8:17 AM
  • Also the RollingFileAppender is loaded dynamically with no XML configuration and is done completely programmatically with the config.

          PatternLayout patternLayout = new PatternLayout
                {
                    ConversionPattern = "%date [%thread] %-5level %logger - %message%newline"
                };
                patternLayout.ActivateOptions();
                RollingFileAppender roller = new RollingFileAppender
                {
                    AppendToFile = true,
                    File = @"ErrorLog.txt",
                    Layout = patternLayout,
                    MaxSizeRollBackups = 5,
                    MaximumFileSize = "1GB",
                    RollingStyle = RollingFileAppender.RollingMode.Size,
                    StaticLogFileName = true,
                    Name = "FileLogger"
                };
                roller.ActivateOptions();
                ((Logger)_log.Logger).AddAppender(roller);

    For example.

     
    Wednesday, October 24, 2018 8:21 AM
  • Maybe, you should post to the Web forums where people use Log4Net.

    http://forums.asp.net/

    Wednesday, October 24, 2018 10:18 AM
  • Hi Probanx Lead Developer,

    This forum discusses and asks questions about the C# programming language, since your issue is more related to log4net that is a third-party component, I would suggest that you could post your issue on stackoverflow with tag log4net & C# for suitable support.

    https://stackoverflow.com/questions/tagged/log4net

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, October 25, 2018 3:18 AM
  • I will go ahead and say that Microsoft refuses to help one of it's official partners to my CTO and CEO.

    And I will close this issue.

    Thank you.

    • Proposed as answer by DerChris88 Monday, October 29, 2018 4:07 PM
    • Unproposed as answer by DerChris88 Monday, October 29, 2018 4:07 PM
    Thursday, October 25, 2018 5:57 AM
  • I will go ahead and say that Microsoft refuses to help one of it's official partners to my CTO and CEO.

    And I will close this issue.

    Thank you.

    Microsoft refuses to help you? Are you serious? I'm not a microsoft developer, so I don't care, but Zhanglong Wu, who is working for microsoft, told you that it looks like a third party issue with log4net and told you where to ask. Do you know where you are actually? It's a forum where developers (of any company) helping developers (not a microsoft support site)... And now you wanna go to your CTO and CEO crying, that microsoft refuses help? Do yourself a favor and don't do that! It will looks ridiculously to them... Calm down and don't kid yourself.

    Monday, October 29, 2018 4:29 PM