Formular una preguntaFormular una pregunta
 

PreguntaSystem.InvalidProgramException

  • jueves, 21 de febrero de 2008 4:44Sanjukta Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
     

    Hi,

    I have a console application which uses Team Foundation APIs. It works perfectly well on my system, but when deployed onto a server, throws weird errors.

    This is the exception:

    System.InvalidProgramException: Common Language Runtime detected an invalid program.
       at Microsoft.TeamFoundation.Client.TeamFoundationServerFactory.GetServer(String name).

     

    This is the statement that throws the exception:

    TeamFoundationServer objTFS = TeamFoundationServerFactory.GetServer("http://"+strApplicationServer+":8080");

     

    I read about this exception and turned off Optimisation hoping that would resolve the problem. It did not help. I even used the PE Verifier to verify the MSIL, and it showed no errors.

     

    Now, I have no clue how to fix the problem. Please help.

     

    Thanks.

     

Todas las respuestas

  • miércoles, 13 de agosto de 2008 14:39Scott Piegdon Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Tiene código
    Have you found any resolution to this problem?  I am experiencing the same issue.  My code is a bit different, because I switched from the factory to the constructor during the debugging of this, but still the first time I try to reference the object generated I get it also:

    System.InvalidProgramException: Common Language Runtime detected an invalid program. at Microsoft.TeamFoundation.Client.TeamFoundationServer.op_Equality(TeamFoundationServer tfs1, TeamFoundationServer tfs2) 

    // Connect to the team foundation server
    TeamFoundationServer tfs = new TeamFoundationServer(
         ConfigurationManager.AppSettings["tfsServer"],
              new System.Net.NetworkCredential(
                   ConfigurationManager.AppSettings["tfsUser"],
                   ConfigurationManager.AppSettings["tfsPassword"],
                   ConfigurationManager.AppSettings["tfsDomain"]));

    if
    (tfs == null)
         throw new Exception("Unable to connect to TFS Service");

    I am very stuck at this point, I have made some very cool sharepoint add-ins that communicate with TFS, however even in a stand alone web application, I cannot seem to access TFS from the server via code.

    Please let me know if anyone has any ideas.

    Thanks!
    Scott Piegdon

  • viernes, 15 de agosto de 2008 10:19nobugzMVP, ModeradorMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    If you are running this code on a 64-bit OS, force the CLR to run in 32-bit mode with the Build, Platform = x86 override.
    Hans Passant.
  • martes, 07 de octubre de 2008 10:33Dickie Howarth Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Hi,

    I'm having the same probelm when trying to connect to the TF Server.

    Did you find a resolution to your problem? I'm not running a 64bit OS, and I have had this code working on the server when running through VS Team edition on the server.

    Now I have migrated the code to a client, could there be a licence issue, as I do not have the Client licence on the machine contacting the server?

    I would have thought there would be a more meaningful error message if it was this though,

    I would be grateful for any comments,

    Thanks.
  • miércoles, 08 de octubre de 2008 3:34sm0kkie Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    I am having the same issue running against TFS 2008 while programming in C# in either VS 2005 or 2008.  My error, however, is being thrown while trying to create a new instance of TeamFoundationServer. I am running on x86 and have forced the platform as such. Any ideas?
    • Editadosm0kkie miércoles, 08 de octubre de 2008 3:36
    •  
  • jueves, 09 de octubre de 2008 13:47Michael Bird from Sharp Dudes Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
     Are the TFS client DLLs present on the machine you're deploying the code to? Does the licensing even allow you to put them there if they are not?
    Please mark the post if it answers your question.
  • viernes, 10 de octubre de 2008 0:14Tim ChenMSFTMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     

    You have to verify the IIS Server have Team Explorer 2008 installed in order for the code to run.

    Tim