问题 无法加载文件或程序集App_Web_xxxxxxxx或其依赖项之一


完整的错误是:

Could not load file or assembly 'App_Web_xxxxxxxx, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

其中xxxxxxxx是ASP.Net生成的临时名称。

我们在ASP.Net应用程序中托管的WCF服务收到此错误。

奇怪的是,它偶尔会发生,与部署更改无关......当它发生时,服务会“中断”所有后续请求。

目前,我们的解决方法是从应用程序的文件夹中删除临时程序集:

%windir%\ Microsoft.NET \ Framework64 \ v2.0.50727 \ Temporary ASP.NET Files

该应用程序使用.Net 3.5在win 2008服务器上的IIS7中托管

任何想法最受赞赏!


4747
2018-04-04 12:29


起源



答案:


在ASP.NET应用程序中使用.SVC时,这可能是ASP.NET编译器的问题。您可以通过关闭批量编译来避免此问题,即在Web.Config下添加以下内容 <system.web> 元件,

<compilation batch="false">

请找到重现问题的步骤,

a. Create a ASP.NET website application and add WCF Service (in this example EPOCS002.svc)
b. Set the “repro-website” directory as the root of a new site (I set it up on IIS 7.5 in classic 
pipeline, 32-bit worker process, .NET 2.0 SP2/3.5SP1, with anonymous authentication enabled).
c. Recycle the application pool for the site.
d. Browse default.aspx
e. Browse EPOCS002.svc
f. Edit default.aspx in some way (add a space somewhere) and save it.
g. Browse again to default.aspx
h. Recycle the application pool for the site.
I. Browse again to default.aspx
J. Browse again to EPOCS002.svc

附:微软此刻正在调查问题的原因,当我提供一些信息时,我会更新帖子。

HTH, 阿米特


10
2018-04-04 13:21



谢谢阿米特。不幸的是,这是一个很复杂的重现(因此测试这个变化)。我试图在我的测试(w7中的iis7)环境中更改aspx文件,并且我尝试通过将应用程序文件夹更改为新构建的源来部署新构建。在这两种情况下,wcf服务继续正常工作。我想知道你是否有任何建议我如何重现这个问题? - Kram
嗨马克,我明天会告诉你重复步骤!! -Amit - amit
很棒的回应 - 非常感谢Amit !!!! - Kram


答案:


在ASP.NET应用程序中使用.SVC时,这可能是ASP.NET编译器的问题。您可以通过关闭批量编译来避免此问题,即在Web.Config下添加以下内容 <system.web> 元件,

<compilation batch="false">

请找到重现问题的步骤,

a. Create a ASP.NET website application and add WCF Service (in this example EPOCS002.svc)
b. Set the “repro-website” directory as the root of a new site (I set it up on IIS 7.5 in classic 
pipeline, 32-bit worker process, .NET 2.0 SP2/3.5SP1, with anonymous authentication enabled).
c. Recycle the application pool for the site.
d. Browse default.aspx
e. Browse EPOCS002.svc
f. Edit default.aspx in some way (add a space somewhere) and save it.
g. Browse again to default.aspx
h. Recycle the application pool for the site.
I. Browse again to default.aspx
J. Browse again to EPOCS002.svc

附:微软此刻正在调查问题的原因,当我提供一些信息时,我会更新帖子。

HTH, 阿米特


10
2018-04-04 13:21



谢谢阿米特。不幸的是,这是一个很复杂的重现(因此测试这个变化)。我试图在我的测试(w7中的iis7)环境中更改aspx文件,并且我尝试通过将应用程序文件夹更改为新构建的源来部署新构建。在这两种情况下,wcf服务继续正常工作。我想知道你是否有任何建议我如何重现这个问题? - Kram
嗨马克,我明天会告诉你重复步骤!! -Amit - amit
很棒的回应 - 非常感谢Amit !!!! - Kram