本文介绍了WCF随机保存吗?崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我遇到了一些随机发生的奇怪的wcf错误:

-我得到了asp.net 4.0网站,其中有一个"FooService.svc",它继承了一些服务类(编译在不同的项目中).
-我使用Windows窗体作为客户端与我的FooService.svc
交谈-一切正常,直到客户端开始出现无法激活服务"异常
-如果我使用IE浏览我的FooService.svc,则会得到类似以下内容的信息:

Hey all,

I''m running into some wierd wcf errors that happen randomly:

- I got asp.net 4.0 web site, with one "FooService.svc" that inherits some service class (compiled in different project).
- I''m using windows forms as a client to talk to my FooService.svc
- All works well until the client starts getting "Cant activate service" exception
- If i browse my FooService.svc with IE i get something like:

[FileNotFoundException: Could not load file or assembly 'App_Web_ynlv0b1k, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39


-如果我浏览其他aspx页面,一切正常.

我认为正在发生的事情(不知道):
-由于某种原因,asp.net/app池会重新编译/回收.svc ?!
-由于某种原因,编译器无法制作"App_Web_yn1v0b1k.dll"(在我张贴的情况下)
-asp.net尝试使用/引用不存在的dll-然后响应异常

要解决此问题,我要么必须重新启动iis,要么在web.config中进行更改以重新进行init的重新编译.

我在Google上搜索了很多东西,发现其他用户也遇到了同样的麻烦,但是没有有效的解决方案.

其他人也有类似的东西吗?


- if i browse other aspx pages, everything works fine.

What i think is happening (no clue):
- asp.net/app pool for some reason inits recompile/recycle of .svc?!
- the compiler for some reason fails to make "App_Web_yn1v0b1k.dll" (in the case i posted up)
- asp.net tries to use/reference the non-existing dll - then responses exception

To fix the problem i either have to restart iis, or make change in web.config to init re-compile again.

I googled a lot and found other users with same trouble, but no solutions that worked.

Anyone else had something similar?

推荐答案


这篇关于WCF随机保存吗?崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 21:36