App_Global.asax.compiled and App_Global.asax.dll missing? WebApi .NET 4.5 project
Asked Answered
T

1

6

During our adventures of building a 'simple' API using WebAPI we've had our fair share of issues as any project does, however I am unable to find any such resource that can explain the following behavior:

Details :
  • Visual Studio 2013 with Update 2 (however, before updating, this was the same)
  • Windows Server 2008 R2
  • Web API 5.1.2

  • The issue seems to be related to the "Publish" command, specifically the "Precompile" option.

      When running via IIS Express, we see no issues at all.

    If we publish once, it fails to include the App_Global.asax.compiled & App_Global.asax.dll in the bin directory. If it is updating an existing instance of the application, it will actually delete the existing two files.

    Note: This Happens regardless of WebPublish or FileSystem Publish

      This behavior is causing 404.0 Errors upon loading to IIS, instead of our expected 201.

    However, if I publish a second time no changes to the previous profile/configuration, it adds the two back.

      For a while, we thought it was permissions issues, and weren't seeing consistent behavior. This happens on all of our development machines with the same behavior.
      We've seen posts regarding mysterious behavior, but from our analysis, this is the root of the problem.
    Ternary answered 22/5, 2014 at 17:40 Comment(1)
    I doubt that I can do anything about McAfee where I'm working, but thanks for the publishing twice in a row info. I can at least use that as a workaround.Lunnete
    T
    7

    Just wanted to let everyone know that my problem was solved.

    This was an issue with a virus scanner scanning the newly created temp directory for precompiling and actually locking the files in question.

    So if anyone has issues such as this and is running any antivirus (especially enterprise level):



    TLDR:

    • Check if your antivirus is locking files.
    • Turn off all compsec scanning utilities and turn on one by one to isolate which is causing problems.
    Ternary answered 29/5, 2014 at 18:20 Comment(1)
    Did anybody find a more permanent solution for this. I have to turn of MsAffe scanning every time I do publishing, which is not convenient and I tend to forget it every time. I would prefer that publish would fail or at least gave me a warning when it couldn't copy one of the files.Delamare

    © 2022 - 2024 — McMap. All rights reserved.