App_Global.asax.compiled 和 App_Global.asax.dll 丢失?WebApi .NET 4.5 项目 [英] App_Global.asax.compiled and App_Global.asax.dll missing? WebApi .NET 4.5 project

查看:23
本文介绍了App_Global.asax.compiled 和 App_Global.asax.dll 丢失?WebApi .NET 4.5 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们使用 WebAPI 构建简单"API 的冒险过程中,我们遇到了与任何项目一样的问题,但是我找不到任何可以解释以下行为的资源:

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:


该问题似乎与发布"命令有关,特别是预编译"选项.


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

    通过 IIS Express 运行时,我们看不到任何问题.
    When running via IIS Express, we see no issues at all.

如果我们发布一次,它将无法包含 App_Global.asax.compiled &bin 目录中的 App_Global.asax.dll.如果它正在更新应用程序的现有实例,它实际上会删除现有的两个文件.

注意:无论是WebPublish还是FileSystem Publish,都会发生这种情况

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

    此行为导致加载到 IIS 时出现 404.0 错误,而不是我们预期的 201.
    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.

推荐答案

只是想让大家知道我的问题已经解决了.

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):



  • 检查您的防病毒软件是否正在锁定文件.
  • 关闭所有 compsec 扫描实用程序,然后一一打开以隔离导致问题的原因.

这篇关于App_Global.asax.compiled 和 App_Global.asax.dll 丢失?WebApi .NET 4.5 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆