Thursday, October 14, 2010

WCF Data Service "Could not load file or assembly App_Web" Error

The "Could not load file or assembly App_Web_" error was showing sporadically on a small test WCF Data Service site.

In my first attempt to solve the issue, I deleted all files in the site, and copied the site files from a deployment package. The data service magically started working.

Later in the day, the same error returned. After researching on the web, came across one lead that suggested deleting all the ASP.Net temporary files. Other posts mentioned issues with compilation. Therefore, as an experiment I adjusted the Web.Config file of the site so that the Compilation node had the following attributes:

debug="false" batch="false"

And this seems to have solved the issue for me - I think each recycle of the Application Pool was causing an attempt to recompile, which was failing for some reason. Probably relates to the other post with regard to some issue around the ASP.Net temporary files folder.

Batch compilation isn't really necessary for this small app, so game over!

1 comment:

ad said...

Worked for me, thanks for the post.