locked
Errors during TFS Build Could not load file or assembly Microsoft.LightSwitch.Server RRS feed

  • Question

  • Hello,

    we have got a Problem during TFS Build 2012 with a Lightswitch Desktop Client 2013 Web Application. If we specify the /t:publish Ms Build Argument in the Build Definition we get always the following error Message:

    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v4.0\Publish\v2.1\Microsoft.LightSwitch.Publish.targets (1061): The "GetPasswordRegexTask" task failed unexpectedly.
    System.Configuration.ConfigurationErrorsException: Could not load file or assembly 'Microsoft.LightSwitch.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. (f:\Builds\16\WWS\CFG.XXX\Binaries\web.config line 146) ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.LightSwitch.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
       at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
       at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
       at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
       at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
       at System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
       at System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase)
       --- End of inner exception stack trace ---
       at System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase)
       at System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, Boolean checkAptcaBit, Boolean ignoreCase)
       at System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType)
       at Microsoft.LightSwitch.Publish.Internal.PasswordHelper.PasswordRequirementProvider.GetPasswordRequirements()
       at Microsoft.LightSwitch.Publish.Internal.PasswordHelper.PasswordRequirementProvider.GetPasswordRequirements()
       at Microsoft.LightSwitch.Publish.Internal.PasswordHelper.GetPasswordRequirements(String webConfigFilePath)
       at Microsoft.LightSwitch.Publish.Tasks.Deployment.GetPasswordRegexTask.ExecuteCore()
       at Microsoft.LightSwitch.Publish.Tasks.Common.BuildTask.Execute()
       at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
       at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()

    What are we doing wrong?

    Kind Regards

    Tuesday, February 11, 2014 9:44 AM

All replies

  • are you building the lightSwitch project or the solution.

    if you are building the solution, build the project instead.

    As from a lightswitch 2013, you can build the solution.


    paul van bladel

    Tuesday, February 11, 2014 11:40 AM
  • Hi Paul,

    thanks for your reply.

    i am building the lightswitch project. i tried both but i am always getting the same error.
    i configured my build like it is described in your blog: blog.pragmaswitch.com/?p=849 . the only difference is that i did not checkin the pvt folder because than i am getting errors during build that this folder is write protected



    • Edited by Silent1984 Tuesday, February 11, 2014 12:33 PM
    Tuesday, February 11, 2014 12:24 PM
  • I have the same problem. And I configured my build like it is described in Pauls blog: blog.pragmaswitch.com/?p=849 . The only difference is as by the other, that I did not checkin the pvt folder because than i am getting errors during build that this folder is write protected.

    What can I do, please? What is the answer of this question? 

    Saturday, August 30, 2014 3:34 PM
  • There is no difference, if the solution or the project will be build. The same error as above.

    My LightSwitch project worked perfect with VS 2012 Update 4. Now after migration to VS 2013 Update 3 I have no build, no publish of the LS project. Why this all problems?

    Please, help. I need help. Please.

    Many, many thanks.

    Saturday, August 30, 2014 3:50 PM
  • as from 2013 (so V4), you should NOT check in the pvt extensions folder. (don't ask me why)

    For existing projects make sure to delete it as well in source control and in the folder which the build server uses temporary for doing the build.


    paul van bladel ==independent enterprise application architect== http://blog.pragmaswitch.com

    Saturday, August 30, 2014 4:33 PM
  • BTW, did you correctly upgrade the build server ?

    paul van bladel ==independent enterprise application architect== http://blog.pragmaswitch.com

    Saturday, August 30, 2014 4:36 PM
  • Hey Paul,

    thank you very, very much for the prompt reply.

    I don't really understand what you mean with "For existing projects make sure to delete it as well in source control and in the folder which the build server uses temporary for doing the build."

    Should I delete the other projects (except Client, Server, Project and WCFRIAServiceProject)  in the LightSwitch solution before I do a Check In? Could the build then successfully ends? I have a project with custom LightSwitch controls.

    I upgrade  the build server (installed VS 2013 Update 3 and I installed the used LightSwitch Extensions). Is there another things to upgrade?

    Once again many, many thanks for your answer.

    Saturday, August 30, 2014 5:04 PM
  • With existing projects, I mean V3 projects you upgraded to V4. 

    For these you should delete the pvt extension folder in source control.

    Try first with a dummy project, native VS 2013 and check if that works.

    installing vs 2013 on build server is indeed sufficient.


    paul van bladel ==independent enterprise application architect== http://blog.pragmaswitch.com

    Saturday, August 30, 2014 5:10 PM
  • BTW, when I build the LightSwitch project without the /t publish argument, then the build ends with success.

    This is at the moment not a satisfaction for me, because all the work regarding Setting up an integrated build and  deploy pipeline for LightSwitch applications (as in your blog on http://blog.pragmaswitch.com/?p=849)  was for nothing (I have spent a lot of time and it works fine with VS 2012 Update 4). What can I do to keep this after the migration to VS 2013 Update 3?

    Saturday, August 30, 2014 5:15 PM
  • I delete the _Pvt_Extensions folder from source control.

    On the build server is everything clean, because by triggering a build, the build agent runs on a virtual machine, that it will run up without any old results from previous builds.

    Please, can I do anything else to make the publish task to work?

    I appreciate your help a lot.

    Saturday, August 30, 2014 5:46 PM
  • What happens with the virgin V4 project, where of course, you do not check in pvt extension folder.

    Does publish work?


    paul van bladel ==independent enterprise application architect== http://blog.pragmaswitch.com

    Saturday, August 30, 2014 7:39 PM
  • does the logging with verbose option gives more info?

    paul van bladel ==independent enterprise application architect== http://blog.pragmaswitch.com

    Saturday, August 30, 2014 7:40 PM
  • Thank you Paul. I see, that you really want to help me. This situation make me crying. I don't know, what can I say to the project manager. The all project is out of order.

    This is the virgin V4 project. After migration to VS 2013 Update 3 no publish worked. As I write above the folder _Pvt_Extensions is not under source control anymore.

    On the development machine the Publish (manually) works.

    The first problem when I was using MSBuild with /p:Configuration=Release /t:Publish the first time was:

    C:\Program Files\MSBuild\Microsoft\VisualStudio\LightSwitch\v4.0\Publish\v2.1\Microsoft.LightSwitch.Publish.targets (315): Could not copy the file "C:\Builds\2\[ProjectName]\[ProjectName]\bin\bin\diagnostics.wadcfg" because it was not found.

    So, I copied the file 'diagnostics.wadcfg' from the folder on the development machine, where the manually Publish worked (..\Sources\[ProjectName]\[ProjectName]\Bin\Release\bin\diagnostics.wadcfg) to the project folder on the development machine (..\Sources\[ProjectName]\[ProjectName]).

    Then I got the error:

    C:\Program Files\MSBuild\Microsoft\VisualStudio\LightSwitch\v4.0\Publish\v2.1\Microsoft.LightSwitch.Publish.targets (1061): The "GetPasswordRegexTask" task failed unexpectedly.
    System.Configuration.ConfigurationErrorsException: Could not load file or assembly 'Microsoft.LightSwitch.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. (C:\Builds\2\[ProjectName]\[ProjectName]\bin\web.config line 182) ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.LightSwitch.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
       at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
       at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
       at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
       at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
       at System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
       at System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase)
       --- End of inner exception stack trace ---
       at System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase)
       at System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, Boolean checkAptcaBit, Boolean ignoreCase)
       at System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType)
       at Microsoft.LightSwitch.Publish.Internal.PasswordHelper.PasswordRequirementProvider.GetPasswordRequirements()
       at Microsoft.LightSwitch.Publish.Internal.PasswordHelper.PasswordRequirementProvider.GetPasswordRequirements()
       at Microsoft.LightSwitch.Publish.Internal.PasswordHelper.GetPasswordRequirements(String webConfigFilePath)
       at Microsoft.LightSwitch.Publish.Tasks.Deployment.GetPasswordRegexTask.ExecuteCore()
       at Microsoft.LightSwitch.Publish.Tasks.Common.BuildTask.Execute()
       at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
       at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()

    Many, many thanks.

    Saturday, August 30, 2014 8:14 PM
  • Hey,

    The content of line 182 in web.config is:

    <add name="AspNetMembershipProvider" type="Microsoft.LightSwitch.Security.ServerGenerated.Implementation.WindowsUserMembershipProvider, Microsoft.LightSwitch.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="_IntrinsicData" applicationName="ProjectName" />

    Many thanks.

    Saturday, August 30, 2014 9:55 PM
  • The diagnostic.wadcfg is a known problem.

    But is that happening also with brand new V4 project. I only have that with upgrade from v3.

    You need also to check in that file.

    Maybe its easier we speak over skype monday.


    paul van bladel ==independent enterprise application architect== http://blog.pragmaswitch.com

    Sunday, August 31, 2014 5:28 AM
  • Hey Paul,

    I appreciate your prompt reply. The diagnostic.wadcfg is under source control.

    How can I contact you monday on skype?

    Many, many thanks.

    Sunday, August 31, 2014 11:11 AM
  • Hi LightSwitch team,

    can someone help me with this problem, please?

    Can somebody tells, if the building of LightSwitch projects with /t:Publish ends successfuly?

    Please help!

    Many thanks.

    Monday, September 1, 2014 7:53 PM
  • Hi,

    did you ever get a solution for this problem? I have exactly the same problem (or at least symptoms). 

    Regards

    Thursday, June 4, 2015 8:21 AM