none
TFS 2012 Build for LightSwitch Application LSCodeGeneratorsTask failed RRS feed

  • Question

  • I created a Build in TFS 2012 for a LightSwitch application and I'm getting the following error:

    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v2.0\Microsoft.LightSwitch.Build.Tasks.targets (247): The "LSCodeGeneratorsTask" task failed unexpectedly.
    System.NullReferenceException: Object reference not set to an instance of an object.
       at Microsoft.LightSwitch.BuildTasks.Common.CommandLineBuildContainerFactory.LoadExtensions(IList`1 extensions, String rootProjectFile, AggregateCatalog aggregateCatalog)
       at Microsoft.LightSwitch.BuildTasks.Common.CommandLineBuildContainerFactory.LoadExtensionsIntoGlobalCatalog(String projectPath, AggregateCatalog aggregateCatalog)
       at Microsoft.LightSwitch.BuildTasks.Common.CommandLineBuildContainerFactory.Create(IEnumerable`1 inputStreams, IEnumerable`1 commonStreams, IEnumerable`1 serviceStreams, String projectPath, IEnumerable`1 externalDataSources)
       at Microsoft.LightSwitch.BuildTasks.CodeGen.OutOfProcGenerationProxy.Initialize(IEnumerable`1 inputStreams, IEnumerable`1 commonStreams, IEnumerable`1 serviceStreams, String projectPath, IEnumerable`1 externalDataSources)
       at Microsoft.LightSwitch.BuildTasks.CodeGen.OutOfProcGenerationProxy.Initialize(IEnumerable`1 inputStreams, IEnumerable`1 commonStreams, IEnumerable`1 serviceStreams, String projectPath, IEnumerable`1 externalDataSources)
       at Microsoft.LightSwitch.BuildTasks.CodeGen.LSGeneratorsTask.RunGeneratorsInNonIdeScenario()
       at Microsoft.LightSwitch.BuildTasks.CodeGen.LSGeneratorsTask.Execute()
       at Microsoft.LightSwitch.BuildTasks.CodeGen.LSCodeGeneratorsTask.Execute()
       at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
       at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()

    The build agent is a Windows7 64-bit machine.
    Any help would be appreciated.  

    Thanks,
    Mike H


    Thanks, Mike

    Wednesday, October 10, 2012 6:10 PM

Answers

  • The option to install for all users is in the manifest for the VSIX so its down to the extension dev. The tell tale sign is the security warning when trying to install a VSIX.

    Dave Baker | Xpert360 blog | twitter : @xpert360 Opinions are my own. Please mark as answer if this helps solve your problem.

    • Marked as answer by MikeH-2 Friday, October 12, 2012 2:37 PM
    Wednesday, October 10, 2012 7:46 PM

All replies

  • See How to automate lightswitch application build while using extensions?

    So you are not alone. Are you able to install your extension(s) on the build server?


    Dave Baker | Xpert360 blog | twitter : @xpert360 Opinions are my own. Please mark as answer if this helps solve your problem.


    Wednesday, October 10, 2012 6:47 PM
  • I installed all the extensions on the build machine and I am able to open VS2012 on the build machine and the application builds just fine.  So, I'm pretty sure the build machine has everything it needs.

    Thanks, Mike

    Wednesday, October 10, 2012 7:15 PM
  • Are your extensions available to the account that the build runs under? Are the extensions available to all users.

    Dave Baker | Xpert360 blog | twitter : @xpert360 Opinions are my own. Please mark as answer if this helps solve your problem.

    Wednesday, October 10, 2012 7:20 PM
  • Well, I don't think there was an option to install for all users or just the current user. But, I set up my own computer as a build agent and ran the build service as myself and it got me past this problem.  So, I'll have to setup the build machine's Build Service to run as a user with more permissions than the default "NT AUTHORITY\NETWORK SERVICE" account.  Thanks Dave.

    Thanks, Mike

    Wednesday, October 10, 2012 7:37 PM
  • The option to install for all users is in the manifest for the VSIX so its down to the extension dev. The tell tale sign is the security warning when trying to install a VSIX.

    Dave Baker | Xpert360 blog | twitter : @xpert360 Opinions are my own. Please mark as answer if this helps solve your problem.

    • Marked as answer by MikeH-2 Friday, October 12, 2012 2:37 PM
    Wednesday, October 10, 2012 7:46 PM
  • Umm, I don't usually disagree with Dave, but I think this time I'm going to have to (even though I could be wrong).

    I'm not sure your error has to do with 3rd-party extensions. "LSCodeGeneratorsTask" seems to be what's causing the error, & even though the error text contains "Microsoft.LightSwitch.BuildTasks.Common.CommandLineBuildContainerFactory.LoadExtensions", to me it looks like there's something missing, so MSBuild isn't able to execute the that particular build task. I guess it could be referring to 3rd-party extensions, the "LSCodeGeneratorsTask" part makes me think it might not be able to load some LS-specific extension.

    The errors in the thread that Dave linked to seems to have different error messages. I'm not saying I have the answer, or even that Dave is "wrong", just pointing out what I see, in case it leads in a direction that helps.

    But I'm not using TFS with LightSwitch myself, So I don't really know what to advise you, but hopefully someone with VS/LS experience will be able to explain what you need to do to fix this.


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    If you find a reply helpful, please click "Vote as Helpful", if a reply answers your question, please click "Mark as Answer"
     
    By doing this you'll help people find answers faster.

    Thursday, October 11, 2012 3:50 AM
    Moderator
  • Hi Yann, you are probably right. I have prodded Mike in the right direction but it does not sound exactly like the situation we had. From other non-LS projects we often have had to run builds under a specific account. I'm far from being a build expert/TFS expert, when that opportunity came around someone else volunteered :)

    Cheers


    Dave Baker | Xpert360 blog | twitter : @xpert360 Opinions are my own. Please mark as answer if this helps solve your problem.

    Thursday, October 11, 2012 6:39 AM
  • What do you guys suggest for automated builds of LightSwitch applications if you aren't using TFS?

    Thanks, Mike

    Thursday, October 11, 2012 1:12 PM
  • Folks, one thing to be aware of when using Team Build for building LS application, you will need to define/set in the Build Definition the property: MsBuild Platform = "X86".

    We have some documentation regarding Team Build and LightSwitch that includes this detail regarding setting the MsBuild Platform value in the build definition. 

    TFS Team Build with LightSwitch

    (Note - these instructions are targeting the scenario where you do not want to install Visual Studio 2012 on the Team Build machine)

    Hope this helps!

    -Robert

    Wednesday, November 28, 2012 6:02 PM
  • Hi,

    I experienced the same error and the issue ended up being a missing extension (in my case the MetroThemeExtension). 

    Cheers,

    Michael


    Friday, February 8, 2013 5:48 AM