无法加载文件或程序集App_Web_xxxxxxxx或其依赖项。

11

完整的错误信息如下:

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.

这里的xxxxxx是ASP.Net生成的临时名称。

我们在托管在ASP.Net应用程序内的WCF服务中遇到了这个错误。

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

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

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

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

非常感谢任何想法!

1个回答

10

在ASP.NET应用程序中使用.SVC可能会导致编译器出现问题。您可以通过关闭批处理编译来避免此问题,即在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

顺便说一句,微软正在调查这个问题的原因,我会在有更多信息时更新帖子。

希望对你有所帮助, Amit


谢谢Amit。不幸的是,这个问题很棘手,难以复制(因此测试这个更改)。我尝试在我的测试(iis7 on w7)环境中更改aspx文件,并尝试通过将应用程序文件夹更改为新构建源来部署新构建。在这两种情况下,wcf服务仍然正常工作。我想知道您是否有任何建议,如何复制该问题? - Kram
嗨马克,我明天会把复现步骤发给你!- 阿米特 - amit

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接