0

I am trying to move a LightSwitch 2012 solution using FormsAuthentication between machines, so I added the solution to TFS (using my TFSPreview account) on one machine and checked everything in.

On the new machine I did a fetch, opened the solution and attempted to run. When the application starts, the Loading... screen is displayed and does not disappear. I do not get an error message.

If I take off the ?IsLaunchedByVS=True from the query string then I do see the login screen.

I zipped up the original working source off the old machine, copied it over to the new machine, opened and ran it. This works correctly and I can get in without needing to change the query string.

I've run a diff between the two folders, there were a couple of differences in the csproj files around the version number being specified in the references the the lightswitch DLLs, I tweaked these so the version number was specified however there is no change.

I've tried this on a third machine, and get the same.

I've run Fiddler when trying to load the machine and here I do see a difference. In the GetAuthenticationInfo request the working original code is returnning a TestUser along with the Permissions set as per the project property dialog. In the code fetched out of TFS the User and permissions are nil. This would appear to be the cause of the application not logging in correctly.

I cannot see the cause of this, can anyone give me any pointers?

Code copied from original machine @GetAuthenticationInfoResponsehttp://tempuri.org/@GetAuthenticationInfoResult aDomainServices i)http://www.w3.org/2001/XMLSchema-instance^ TotalCount��^IncludedResults b9http://schemas.microsoft.com/2003/10/Serialization/Arrays_anyType.type�c:User cehttp://schemas.datacontract.org/2004/07/Microsoft.LightSwitch.Security.ServerGenerated.ImplementationFullName� Test UserName�TestUser Permissions_string�!LightSwitchApplication:IsAccounts_string�LightSwitchApplication:IsOffice_string�!LightSwitchApplication:IsEngineer_string� LightSwitchApplication:IsManager_string�5Microsoft.LightSwitch.Security:SecurityAdministrationRoles.nil�^ RootResults behttp://schemas.datacontract.org/2004/07/Microsoft.LightSwitch.Security.ServerGenerated.Implementation_AuthenticationInfo_AuthenticationType�Forms_UserName�TestUser

Code from TFS @GetAuthenticationInfoResponsehttp://tempuri.org/@GetAuthenticationInfoResult aDomainServices i)http://www.w3.org/2001/XMLSchema-instance^ TotalCount��^IncludedResults b9http://schemas.microsoft.com/2003/10/Serialization/Arrays_anyType.type�c:User cehttp://schemas.datacontract.org/2004/07/Microsoft.LightSwitch.Security.ServerGenerated.ImplementationFullName.nil�Name Permissions.nil�Roles^ RootResults behttp://schemas.datacontract.org/2004/07/Microsoft.LightSwitch.Security.ServerGenerated.Implementation_AuthenticationInfo_AuthenticationType�Forms_UserName

Duncan Watts
  • 1,331
  • 9
  • 26
  • I've set the Authentication to "Do not enable authentication" within the project properties which lets me in, however I obviously don't have my roles set. It all appears to be related to the `GetAuthenticationInfo` not returning the TestUser but as all this is hidden with LightSwitch I cannot see how to resolve this. – Duncan Watts Jul 03 '12 at 11:28

2 Answers2

0

In the last couple of weeks there was a question like this on the MSDN Forums for Lightswitch. The user found that in their case they had not loaded all of the required files and intrinsic data into TFS. Note that Lightswitch has data files and configuration files that you need to add to the source control system.

Mykre
  • 56
  • 3
  • That user was me cross posting the same issue :) It was not an issue caused by the files not being loaded into TFS but the LightSwitch project itself not copying a required file for debug into the project output folder. – Duncan Watts Jul 10 '12 at 09:38
  • The thread on the MSDN forums is http://social.msdn.microsoft.com/Forums/en-US/LightSwitchDev11Beta/thread/902a461e-6597-45ce-ac9e-f7724607070e – Duncan Watts Jul 10 '12 at 09:42
0

Looks like this is a fault with LightSwitch not copying a file required for launching from Visual Studio.

See related thread here: http://social.msdn.microsoft.com/Forums/en-US/LightSwitchDev11Beta/thread/902a461e-6597-45ce-ac9e-f7724607070e

See logged bug here: https://connect.microsoft.com/VisualStudio/feedback/details/753056/lightswitch-in-vs2012rc-does-not-copy-microsoft-lightswitch-design-server-manifest-dll-to-project-output-folder#tabs

Workaround is to copy: "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\LightSwitch\Server\Manifests\Microsoft.LightSwitch.Design.Server.Manifest.dll" to "{Project}\Bin\Debug\Web\Manifests\Microsoft.LightSwitch.Design.Server.Manifest.dll".

Duncan Watts
  • 1,331
  • 9
  • 26