Poser une questionPoser une question
 

QuestionSystem.InvalidProgramException

  • jeudi 21 février 2008 04:44Sanjukta Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
     

    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.

     

Toutes les réponses

  • mercredi 13 août 2008 14:39Scott Piegdon Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     A du code
    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

  • vendredi 15 août 2008 10:19nobugzMVP, ModérateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    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.
  • mardi 7 octobre 2008 10:33Dickie Howarth Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    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.
  • mercredi 8 octobre 2008 03:34sm0kkie Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    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?
    • Modifiésm0kkie mercredi 8 octobre 2008 03:36
    •  
  • jeudi 9 octobre 2008 13:47Michael Bird from Sharp Dudes Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
     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.
  • vendredi 10 octobre 2008 00:14Tim ChenMSFTMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     

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

    Tim