Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

- 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?
Posted
Updated 10-Jan-12 0:17am
v2

1 solution

Are you closing the WCF Client in the code end like
WCFClient.Close(); or use using() function.

if yes, then do write the code here.
 
Share this answer
 
Comments
HaBiX 12-Jan-12 3:19am    
We're using the client inside the using block. In some routines we're even manually calling Dispose instead of using "using" block, to get the exceptions back correctly.

I dont think the problem is in wcf client as the wcf service falls down. I can then restart IIS, but not WCF client inside windows forms and the next call to wcf will succeed.
abhay bansal 13-Jan-12 2:00am    
How about application pool? using 2.0 or 4.0?
HaBiX 13-Jan-12 3:11am    
On first web site we're experiencing this app pool is set to .net 4.0. But as it is external hosting, we cant get to app pool settings.

On other web site (which runs on server we can access fully) app pool is set to 2.0 (default settings; running on Network Service identity)

We get the same problem on both sites.


The first asp.net app now has a timer, that echoes svc every 5 min. When it gets this exception, it writes a space at end of web.config to recompile the web. I'am ashamed of this fix :X but its the only way to keep that site alive.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900