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!

Sunday, October 10, 2010

Web Application with Host Header on Port 80 Fails

Adding new SharePoint web applications on port 80 is easy by associating a host header name, but I was unable to view the site collection in the new web application with IE - the login dialog box would show three times, and then just a blank page, even though my account was the primary site collection administrator.

Turns out that in Windows 2008 R2 it is necessary to disable the loopback check. Open the Powershell ISE or console (as administrator to get sufficient registry permissions!) and run the following script:

New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name "DisableLoopbackCheck" -value "1" -PropertyType dword

Thanks to Ignacio Montenegro of IGA Systems for that tip.