Blog

All posts tagged 'Lightswitch'

Check out all of the posts tagged with 'Lightswitch' below. If you still can't find what you are looking for, try using the search box.

Unable to load data - please check your network connection and try again

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:

  1. Open TMG, click Firewall Policy
  2. Right-click on the rule you use to publish your Lightswitch app and select Configure HTTP.
  3. Uncheck Block high bit characters and Verify normalization.
  4. Click OK and then Apply the rule.

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.

Take care,

John

Popular tags: , ,

data loss might occur - SQL single user mode

I've been having challenges Publishing Lightswitch apps when selecting the option to "update an existing database".  For some reason, the Publish will at times run and run and never finish forcing me to kill Visual Studio.  I'm still working on the cause of that issue but when it does work, if you've deleted table rows in your LS app, you'll get an error when you try to Deploy on IIS that says:

Rows were detected. The schema update is terminating because data loss might occur.

Once you get this your database is now stuck in Single User Mode.  Here's the quick fix:

Open a query window in SQL Management Studio.

USE [master]

ALTER DATABASE [your locked DB] SET MULTI_USER WITH ROLLBACK IMMEDIATE

GO

 

 

Popular tags: ,