aeternus828
aeternus828

Reputation: 67

Troubleshooting Silverlight 5 and Ria services [Web-Services-AuthenticationService.svc does not exist]

I have two different versions of a Silverlight 5 project using Ria services. Both work locally. The older version (A) works when deployed to ISS7. The new version (B) does not. There is user/password authentication that fails for version B with the error:

Referencing various SO and MSDN posts over the past week, I have tried many troubleshooting techniques. Adding error logging as suggested here to the web.config results in the following being logged:

Researching that led to finding this forum post which suggests creating a dummy .svc file with the name/path it is looking for. The result:

The details of the above error aren't largely important as it was a blank .svc file I supplied. It merely served to confirm that fact that the project was indeed dependent on it

Here's the kicker... the working version DOES NOT contain this file either, yet it does not throw an exception.

Searching for any reference to needing the service surprisingly turned up a result in both solutions. Both MyApp.Web.g.csfiles are identical (ran a CSDiff) and both contain the line:

Both have the same package/deploy settings. I am deploying to a file system, then copying the files over to IIS on my host server.

Questions:

  1. Where is a setting that makes this .svc file a requirement? It's clearly not needed in version A, but is in version B. Again, file MyApp.Web.g.csis the only reference to it, and it exists in both versions.

  2. MyApp.Web.g.cs is a generated file. What service in Visual Studio 2010 creates this file? Also, can I modify it to not include the call to the .svc file in question?

I'm going to start merging the two solutions together to see at which point the .svc file becomes neccessary. Any ideas in the meantime would be greatly appreciated!

Upvotes: 2

Views: 3052

Answers (3)

Simon_Weaver
Simon_Weaver

Reputation: 145920

Before you do any of this make sure the regular bin folder is actually deployed containing your actual code.

I was deploying with MSDEPLOY to a new server and it did not deploy bin folder. You're not going to get anywhere without that!

Upvotes: 0

Xiaodong Tan
Xiaodong Tan

Reputation: 101

Besides making sure that the "DomainServiceModule" entries are present in Web.Config as stated above, another thing is that RIA requires ASP .NET compatibility mode to be enabled. Here is a link to Microsoft's deployment guide for RIA:

http://msdn.microsoft.com/en-us/library/ff426912(v=vs.91).aspx

In the third paragraph of the "Configure the Web Server" section, it states that you need the following in your Web.Config file:

<system.serviceModel> ... <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> ... </system.serviceModel>

When this is missing, you get the behavior described in your question.

Upvotes: 0

mCasamento
mCasamento

Reputation: 1433

WCF Ria Services registers an HttpModule in order to manage the wcf ria services calls. When the request arrive to the server that module read the url and understand which service to instantiate and which method to call. So it's absolutely normal that you don't find any .svc file
Don't mess with the .g.cs your problem isn't here.
Take a look at your web.config file, you should find rows like this

<system.web>
    <httpModules>
      <add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </httpModules>
...
</system.web>

and this

    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true">
          <add name="DomainServiceModule" preCondition="managedHandler" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </modules>
...
</system.webServer>

Upvotes: 1

Related Questions