Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello, I have search everywhere for a solution to my problem, but I am not able to find one. I have built a Silverlight 4 Navigation app, and am using RIA Services to process a custom entity (which is essentially running server-side calls to COM dlls). In my debug environment, everything works fine, but when I try to deploy to IIS7 (on the development machine) as a website, it gives me the following error when calling the Get query on the entity:

Load operation failed for query 'GetNewHWCoil'. The remote server returned an error: NotFound.<br />
 <br />
   at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error)<br />
    at System.ServiceModel.DomainServices.Client.LoadOperation.Complete(Exception error)<br />
    at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult)<br />
    at System.ServiceModel.DomainServices.Client.DomainContext.<>c__DisplayClass1b.<load>b__17(Object )</load>

Everything I found online says to check the Authentication area on IIS and make sure that it is set only to Anonymous Authentication, which it is. And they also say to enable WCF logging, which when I add the necessary text to the web.config file, I still don't get any logs. They also say to use Fiddler2 to trace the HTTP calls, but I only get a 404 error on there with the textview giving me the standard IIS file not found website. I cannot figure out how to debug this problem.

The Silverlight app needs to make calls to a set of 3rd party COM dlls to calculate the performace of water coils. Since I do not want to have the app run OOB, (this will negate the whole point of it being a web app instead of a WPF app) I have the ASP.net project interacting with the dlls using the custom entities.

The function (or Query as RIA services calls it) GetNewHWCoil is located in the DomainService class and uses this code:



Public Function GetNewHWCoil() as HWCoil 'HWCoil is a custom object
   If bRanCalc then 'bRanCalc is a global boolean variable that gets set to true if the calc call on the dlls have been made
      Return mHWCoil 'global copy of the calculated coil object
      bRanCalc = False
   else
      Return New HWCoil
   end if
End Function




The error runs before any calculation should be called, so it is assumed that it is erroring on the 'Return New HWCoil' part.

Any help on this would be appreciated.

Thanks,

Chris
Posted
Comments
Mark Salsbery 24-May-11 21:11pm    
That error is pretty generic. Any more info in the innerexceptions of any exceptions you're getting back?

Make sure the app pool your service is running in has sufficient rights for anything your service is doing.

If you're using any authentication schemes, make sure they are turned on and/or configured properly on IIS.

And I always say this, but if you plan to deploy to IIS, then debug on IIS....then you'll catch these problems early :)
buzzluck68 25-May-11 8:07am    
Unfortunately I am unable to get any other errors back since this is a WCF error.

I have even tried to have logging done on the ASP page that is doing the work, and there are no errors there, and no errors on the Silverlight side. It seems to be in the WCF service area, which from what I have found online, I would need to have WCF log the error messages, but no matter what I do I cannot get it to do that.

As far as debugging on IIS, I am not very familiar with IIS, so I have no idea how to do that. There are also no authentication schemes, there is only one enabled on the site (Anonymous Authentication). This should be sufficient.

The application pool is using .NET Framework 4, and the .NET trust level is set to Full (internal).

What I want to know is why I can right click on the asp page in the project IDE, and select "View in Browser" and it runs fine (this is not in debug mode, but still running as http://localhost), yet when run from IIS it has this problem? What is the difference?

Thanks,
Chris
Mark Salsbery 25-May-11 14:42pm    
Please use the "Reply" button if you want quicker response from me...otherwise I may only find your comment by accident since I don't get a notification email. :)

IIS is a completely different host with many more configuration options, so there are deployment issues (which are minimal with WCF RIA Services).

For debugging with IIS...If you install IIS on your dev machine, you can go to your service host project's properties page, go to the "Web" tab, and in the "Servers" section choose "Use local IIS web server". Click the "Create Virtual Directory" button, and when that succeeds you're all set - if you run your web app in the debugger it will run from IIS server.

Have you gone through these?

Troubleshooting the Deployment of a RIA Services Solution[^]
Deploying an Internet Information Services-Hosted WCF Service[^]
A Guide to Deploying RIA Services Solutions[^]
buzzluck68 26-May-11 9:10am    
This did the trick to get rid of the error message. The only problem now is that the calculation results from the server are not being returned. That I will see if I can debug, since it does that when in debug mode now also.
Thanks for the help,
Chris
buzzluck68 26-May-11 14:28pm    
Now I get the error:
"Retrieving the COM class factory for component with CLSID {...} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))"

This only occurs if I have the debug mode using IIS on the dev machine. If I have it debug using the VS Dev Server there are no errors.

I have used the 32-bit regsvr32 (under SysWOW64 folder) to make sure the dlls are registered. The machine is a Win7 64-bit machine. (I have also done the 64-bit regsvr32, but still the same problem.)

Start by calling your WCF RIA service from an internet browser. WCF RIA services automagically creates an endpoint for you to connect on. Try it and check if you can get it to work without using your client.

The endpoint is located at the following url:

[ApplicationBaseURI] + [DomainServiceFullName].svc (With all "." replaced by "-")


This won't solve your problem directly but maybe give you some pointers as to where your error is.
 
Share this answer
 
v2
Many thanks to Mark Salsbery for the answer to this problem.

When I changed the project to debug from IIS, it told me that I needed to install ASP.NET 4 on my server. I thought I had already done that by using the Add Windows Features, but apparently that only intalled ASP.NET 2.

So I looked online and found that I needed to run the command C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis -i. This did the trick.

Again thanks for the help,
Chris
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900