Do you have the Red X and the error "unable to load data" in certain parts of your LightSwitch application. This problem has plagued lots of people as it's just about the worse, most generic error message. The "Unable to load data" does nothing to point you in the right direction. I followed Michael Washington's post and turned on tracing but that didn't give me any clues. Finally in this post Sheel Shah with Microsoft suggested using Fiddler to see what errors might be coming back. (Notice that the fix to the original issue posted by Mr. Yossu was totally different then my issue though we both had that same generic unable to load data error).
Turns out Fiddler did reveal the following:
Error Code: 500 Internal Server Error. The request was rejected by the HTTP filter.
Suddenly, I had something to search on which led me to this post. As soon as I read it, I knew that was my issue as we are being a TMG firewall. To test, I accessed the deployed app by internal IP through a VPN and guess what?...No Red X's. So, if you have deployed your LS app behind TMG (or ISA), here's what you need to do:
Based on the Stack Overflow post, I thought just unchecking Block High Bit Characters would work but it didn't. Checking TMG logs I found that my actual error was "Blocked by the HTTP Security filter: URL normalization was not complete after one pass". I should have known this as we've been bit by the "Verify Normalization" setting previously when deploying a Silverlight Web app. After making the changes to the HTTP Filter, it took a few minutes to take effect (probably because we have a TMG array) but in just a few minutes, everything was coming up Red X free. I hope this help someone else. It won't fix all the "Unable to Load Data" issues as there are a ton of other scenarios that will give you that error, but it will fix those with the error when TMG is the culprit.
This error is so generic, it's a pain to uncover the real issues. I have seen this error several times while working on my project. I had the same problem with a published lightswitch project when trying to view a table, even though I could successfully query the data through management studio. This time, it was simply due to an incorrect formula in a computed field. Other things you can try, if you can't identify the specific cause of the error are: - Restart the SQL Server Agent from Management studio - Restart the database server - Kill all connections to the database or table. (Sometimes a stalled process could be locking the table or could affect the loading of the data from the front end)
Click here to cancel reply.
Remember my details
Notify me of followup comments via e-mail