title: Troubleshooting Silverlight 5 and Ria services [Web-Services-AuthenticationService.svc does not exist]
body: <p>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:</p>
  
  <ul>
  <li><code>Load operation failed for query 'Login'. the remote server returned an error: NotFound.</code></li>
  </ul>
  
  <p>Referencing various SO and MSDN posts over the past week, I have tried many troubleshooting techniques.  Adding error logging as suggested <a href="http://forums.silverlight.net/t/186739.aspx/1/10" rel="nofollow">here</a> to the web.config results in the following being logged:</p>
  
  <ul>
  <li><code>The service '/ClientBin/MyApp-Web-Services-AuthenticationService.svc' does not exist.</code></li>
  </ul>
  
  <p>Researching that led to finding <a href="http://forums.silverlight.net/t/218547.aspx/2/10#" rel="nofollow">this forum post</a> which suggests creating a dummy .svc file with the name/path it is looking for.  The result: </p>
  
  <ul>
  <li><code>The service '/ClientBin/DBCRM-Web-Services-AuthenticationService.svc' cannot be activated due to an exception during compilation.  The exception message is: The ending bracket '&amp;gt;' for the 'ServiceHost' directive is missing in the '.svc' file..</code></li>
  </ul>
  
  <p>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</p>
  
  <p>Here's the kicker... the working version <strong>DOES NOT</strong> contain this file either, yet it does not throw an exception.  </p>
  
  <p>Searching for any reference to needing the service surprisingly turned up a result in both solutions.  Both <code>MyApp.Web.g.cs</code>files are identical (ran a CSDiff) and both contain the line: </p>
  
  <ul>
  <li><code>public AuthenticationContext() : 
              this(new WebDomainClient&lt;IAuthenticationServiceContract&gt;(new Uri("DBCRM-Web-Services-AuthenticationService.svc", UriKind.Relative)))
      {
      }</code></li>
  </ul>
  
  <p>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.</p>
  
  <p>Questions:</p>
  
  <ol>
  <li><p>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 <code>MyApp.Web.g.cs</code>is the only reference to it, and it exists in both versions.</p></li>
  <li><p><code>MyApp.Web.g.cs</code> 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 <code>.svc</code> file in question?</p></li>
  </ol>
  
  <p>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!</p>