Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LightSwitch 'Microsoft-LightSwitch-Security-ServerGenerated-Implementation-AuthenticationService.svc' does not exist

I have exercised my frustration to its utmost today while trying to deploy a Lightswitch application to a Windows 2008 R2 server running IIS 7.5. Upon navigating to the application, I receive the following execrated error:

Load operation failed for query 'GetAuthenticationInfo'. The remote server returned an error: NotFound.

Both the .NET trace and server Event Log have this to say about it:

Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/63835064 Exception: System.Web.HttpException (0x80004005): The service '/Web/Microsoft-LightSwitch-Security-ServerGenerated-Implementation-AuthenticationService.svc' does not exist.

Configuration details are as follows:

  • I have selected "Do not enable authentication" under my Access Control options.
  • In my "Application Server Configuration" publish options, I am selecting IIS Server with the prerequisites checkbox unchecked.
  • Under "Publish Output", I'm creating a package on my local disk. Later, I'm copying that package to the server and running the .deploy.cmd manually, which appears to work fine.
  • My database connection under "Other Connections" is correct -- it is a SQL login that works from my box, and other sites on this server connect to the same DB server with no trouble.

On the server side:

  • The site is running in its own app pool in .NET 4.0 Integrated Mode, using the ApplicationPoolIdentity.
  • Only anonymous authentication is enabled.

What I've tried:

  • Installed all the Lightswitch stuff for 2011 and 2012 from the Web Platform Installer.
  • Installed RiaServices.msi.
  • Repaired .NET 4.5.
  • Ran aspnet_regiis -i

None of these had any effect at all. The only hint I have about the bolded error above is that that .svc is generated at runtime, and that it will throw a 404 error if some other issue occurs on the WCF end. (That's why I tried the RiaServices.msi install.)

I am able to "Remotely publish to a server now" to my own local IIS Express, and the app there works fine. Copying those files to the remote server yields the same result as before, however.

Any suggestions on how to troubleshoot this further?

like image 999
Facio Ratio Avatar asked Nov 09 '12 23:11

Facio Ratio


3 Answers

The problem was that the Lightswitch application was deploying with Microsoft.Data.Services 5.0.2.0, but Microsoft.LightSwitch.Server 11.0.0.0 must reference Microsoft.Data.Services 5.0.0.0. Once I deployed 5.0.0.0 to the web server, the application ran as expected.

I found this problem by trying to navigate directly to /Microsoft.LightSwitch.SecurityData.svc, which is a static service that deploys with the application, and then following the YSOD instructions.

like image 107
Facio Ratio Avatar answered Oct 19 '22 03:10

Facio Ratio


If you are getting this issue after you have installed Visual Studio 2013 or have installed a version of .NET that has newer OData than 5.0.0.0 on your development box, the problem is occurring because new versions of OData assemblies were installed and the LightSwitch Server project is now using these (which are incompatible). You can address the issue by updating your Server.csproj (or vbproj) to refer to the previous version of the OData assemblies.

Add HintPath nodes to the following 5 assembly entries in your Server\Server.CSProj

<Reference Include="Microsoft.Data.Edm">
  <HintPath>C:\Program Files (x86)\Microsoft WCF Data Services\5.0\bin\.NETFramework\Microsoft.Data.Edm.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Microsoft.Data.OData">
  <HintPath>C:\Program Files (x86)\Microsoft WCF Data Services\5.0\bin\.NETFramework\Microsoft.Data.OData.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Microsoft.Data.Services">
  <HintPath>C:\Program Files (x86)\Microsoft WCF Data Services\5.0\bin\.NETFramework\Microsoft.Data.Services.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Microsoft.Data.Services.Client">
  <HintPath>C:\Program Files (x86)\Microsoft WCF Data Services\5.0\bin\.NETFramework\Microsoft.Data.Services.Client.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="System.Spatial">
  <HintPath>C:\Program Files (x86)\Microsoft WCF Data Services\5.0\bin\.NETFramework\System.Spatial.dll</HintPath>
  <Private>True</Private>
</Reference> 

This problem doesn't occur on projects that were upgraded to the V3 project system (with VS 2012 Update 2) or V4 projects (VS 2013) because we addressed how these assemblies were referenced. So an alternative solution is to right-click on the project and choose "Upgrade Project"

David Kidder | Senior SDET | Microsoft | LightSwitch

LightSwitch Forum Post Answer to this Question

like image 4
Dave Kidder Avatar answered Oct 19 '22 01:10

Dave Kidder


I had same problem. Go to your application on the IIS, then double click on Authentication. Select Windows Authentication and disable that.

like image 2
Mahmood Reza Jahanseir Avatar answered Oct 19 '22 02:10

Mahmood Reza Jahanseir