Solved

MySQL + EntityFramework 4 crashes on remote server

Posted on 2010-09-15
6
845 Views
Last Modified: 2012-08-13
I'm quite new to both Silverlight and Entity Framework.
I have started a new application that uses the Entity Framework to connect to a MySQL table. It is supposed to populate a grid with the entities from the table.

Everything works greate from the development machine.
The MySQL server is a remote server and do accept connections and everything is simply perfect here.

However after publishing (VS2010) the application to the webserver I've got stuck with this error:
On a line that does the Single() method of Linq there's an error saying that "Sequence contains no elements". There are elements on the database however. Double-checked here.

Using IE i get another error (status bar - alerts):

Unhandled Error in Silverlight Application Load operation failed for query 'GetSacado'. The remote server returned an error: NotFound. em
System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error) em
System.ServiceModel.DomainServices.Client.LoadOperation.Complete(Exception error) em
System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult) em
System.ServiceModel.DomainServices.Client.DomainContext.<>c__DisplayClass1b.<Load>b_17(Object)


That's it.
I can't run the remote debugger to check and I really don't know what's going on here...

I'm using MySQL Connector/Net 6.3.4.0


Any clue?
0
Comment
Question by:LordALMMa
  • 4
  • 2
6 Comments
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 33683407
Is it possible that when on a live system the query will not return anything?

Can you post the query?
0
 
LVL 1

Author Comment

by:LordALMMa
ID: 33683583
The query should return ONE (and only one) element.
It's a test query that I'm using that checks for a specific PK ('11111111111111').

Using the MySQL Workbench from any machine (same user that I've used to create the Entity Framework model) I'm able to see the specific row with no trouble.
Running on the development machine also works fine.
Running on a remote server it sticks with that error.

As I said the same website works fine if it's LOCAL but when I publish it to my intranet IIS or remote IIS (DiscountAsp) I have this same issue ("Sequence contains no elements").

I'm using this code to filter the data:

contexto.Load(contexto.GetSacadoQuery().Where(_sacado => _sacado.documento.Equals('11111111111111'))).Completed += loadSacado_Completed;

However if I'm not mistaken if this code works local and since it was not changed before publish, it should keep working there also...

Anyway, it is NOT possible that the query would not return data.
And it works on the development machine (development IIS).
Just not on a deployment IIS environment.
0
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 33684214
Then I would check the config of the two machine and see what differs. I am not an ASP .Net programmer so I will most likely not be of much help then.
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 1

Author Comment

by:LordALMMa
ID: 33686048
Switched to SQL Server.
Not working too.

So it is NOT related to MySQL.
It's something related to the IIS and WCF RIA.

Keep getting the same errors.

Clues?
0
 
LVL 1

Author Comment

by:LordALMMa
ID: 33686285
Now I have found the error but no solution yet.

On the development machine I can access the service created by WCF-RIA:
http://localhost:58090/ClientBin/WebNS-Web-Services-BoletoService.svc

However on the remote (intranet) server I cannot.
Accessing http://sites:2000/ClientBin/WebNS-Web-Services-BoletoService.svc shows me an 404 error.

Any clue here?
I may have to configure the IIS for this, but I'm not sure how and what needs to be done...
0
 
LVL 1

Accepted Solution

by:
LordALMMa earned 0 total points
ID: 33688200
Solution found.

Since I'm new to Entity Framework, Silverlight, WCF, RIA and related stuff, I didn't fully understand the whole process of getting the data from the DB to the silverlight page.

After reading some blogs on how to deploy and how this works, I decided to give a try to Fiddler.

So I discovered that my service (SVC) could not be found.

I decided to try on the development IIS. Worked.
However on the deployment IIS the service did nt exsit.

So I started digging around that for a while and found an article that told me to upload the 3 DLLs form System.ServiceModel that aew referenced on my Web project. I was already deploying 2 of them, but NOT the EntityFramework one.

After this, the error on the service changed from 404 to an ASP error page telling me that "'Microsoft.VisualStudio.Diagnostics.ServiceModelSink" could not be loaded.

I found two articles about this error:
http://social.msdn.microsoft.com/forums/en-US/wcf/thread/07ed7bd1-2c73-430b-a414-9a57e3aaf371
and
http://connect.microsoft.com/VisualStudio/feedback/details/593275/microsoft-visualstudio-diagnostics-servicemodelsink-assembly-fails-to-load-in-some-cases-for-no-apparent-reason



Since I (at least for now) do not need this assembly, just removed it from the machine.conf as the first article told me to.
After that everything was just fine =)
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now