Skip to main content

Microsoft Silverlight

Answered Question Bleeding Edge Syndrom: Major problems deploying SilverLight on IIS RSS Feed

(0)

mNasser
mNasser

Member

Member

0 points

4 Posts

Bleeding Edge Syndrom: Major problems deploying SilverLight on IIS

We just finished programming our first SilverLight app.  It works beautifully except that we cannot deploy it anywhere!  It even fails on our development station.  We're running against a solid deadline and supposed to have deployed the software on customer's site today.  However, this installation problem is making it impossible to benefit from a lot of programming work we put on the system in the past few weeks! 

Our boss is blaming the development team for choosing new technology for this project.  He calls this "Bleading Edge".  Can someone help us get this working before we all get fired!  Here is a description of the problem:

  • Silverligth + WCF + WCF makes call to a multithread COM DLL 
  • It all works very well when run from VS2008
  • After published to IIS However, outside of the IDE it gives an unknown exception when it does a WCF call
  • Out tside the development server it doesn't work
  • It always works when the development is on
  • .svc file is not recognized outside development

And here is the exception I get:

An exception occurred during the operation, making the result invalid. Check InnerException for exception details.

at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()

at AccuSLLink.AccuService.GetStudentCompletedEventArgs.get_Result()

at AccuSLLink.Home.OnGetStudentCompleted(Object sender, GetStudentCompletedEventArgs e)

at AccuSLLink.AccuService.AccuServiceC

I'll be monitoring this post during the weekend.  Please reply if you have ideas.  TIA.

rjacobs
rjacobs

Participant

Participant

920 points

155 Posts

Re: Bleeding Edge Syndrom: Major problems deploying SilverLight on IIS

Start with checking if you can open the wcf service svc file in a browser from IIS (right click, browse), or you can use http://urdomain/wcfwebserivce.svc .  This will determine if the problem is on your silverlight application or wcf hosting settings. Post what happens...

Regards,
Rob Jacobs

davidezordan
davidezo...

Contributor

Contributor

5684 points

872 Posts

Silverlight MVP

Re: Bleeding Edge Syndrom: Major problems deploying SilverLight on IIS

Hi,

read this article and follow all the steps described.

  • verify if your WCF service is running on the production server;
  • use a tool like WcfTestClient.exe to verify the method calls;
  • verify the service references of your Silverlight application: they have to point to the correct URL of the deployed services

HTH.

Thanks, Davide

Silverlight MVP

Blog Twitter Silverlight Experts

MarauderzMY
MarauderzMY

Member

Member

607 points

265 Posts

Re: Re: Bleeding Edge Syndrom: Major problems deploying SilverLight on IIS

Another interesting problem which I ran into with WCF was the fact that my web application was listening for requests on multiple IPs. Which WCF didn't like.

Search for baseAddressPrefixFilters on the net and see what you get.

mNasser
mNasser

Member

Member

0 points

4 Posts

Re: Re: Bleeding Edge Syndrom: Major problems deploying SilverLight on IIS

Thanks for the anser Rob.  webservice.svc works in the browser, but when a call is attempted it fails? Crying

mNasser
mNasser

Member

Member

0 points

4 Posts

Re: Re: Re: Bleeding Edge Syndrom: Major problems deploying SilverLight on IIS

This is terrible. We worked on it the whole weekend without a resolution! 

We think it has to do something with "endpoint" configuration
It writes the web.config and clientconfig files, but I don't understand exactly which I need to change and how
"Unhandled Exception: System.InvalidOperationException: Could not find default endpoint element that references contract 'IAccuService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element."

I get this when I invoke the .svc and make a call to one of the metods from a console test code:
AccuServiceClient client = new AccuServiceClient();

foreach(var t in client.GetTutorList())
{
  Console.WriteLine("{0} {1}",t.FirstName,t.LastName);
}
client.Close();

It says something wrong in endpoint but we could not figure out what.

siteman
siteman

Member

Member

102 points

30 Posts

Re: Re: Re: Bleeding Edge Syndrom: Major problems deploying SilverLight on IIS

It seems like you would have already checked this, but I feel like I should ask anyway - sometimes it's the simple things...

Have you made sure that you're pointing to the right URL?  This Thread is dealing with the same issue, but the recurring theme is not to rely on the URL in the ServiceReference.ClientConfig and to set it in the code.  Here is a post about that.  You gotta watch ouf for those port numbers that VS tacs on when running it inside the IDE.

 

mNasser
mNasser

Member

Member

0 points

4 Posts

Answered Question

Re: Re: Re: Re: Bleeding Edge Syndrom: Major problems deploying SilverLight on IIS

Thank you all for your suggestions.

We finally solved this problem by explicitly specifying the endpoint in code.  For those interested in the solution, here it is:

Original:
MyService.MyServiceClient client = new MyService.MyServiceClient();

Changed to:
Uri address = new Uri(Application.Current.Host.Source, "../MyService.svc");
           MyService.MyServiceClient client = new MyService.MyServiceClient("BasicHttpBinding_IMyService", address.AbsoluteUri);

Now it works even if location changes.

Another solution was to have the endpoint entry match exact location in config (VS writes something else).

Hope this helps others with similar problems.

Jean-Pierre Fouche
Jean-Pie...

Member

Member

27 points

31 Posts

Re: Re: Re: Re: Bleeding Edge Syndrom: Major problems deploying SilverLight on IIS

Yes, I see that servicereference.config is not configurable during deployment - it is packaged inside the .xap file, I suppose. I am configuring my WCF URL's in the InitParams, loading AppSettings into the web.config to load it into the InitParams on the aspx page.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities