Microsoft Developer Network > 포럼 홈 > Common Language Runtime > System.InvalidProgramException
질문하기질문하기
 

질문System.InvalidProgramException

  • 2008년 2월 21일 목요일 오전 4:44Sanjukta 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
     

    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.

     

모든 응답

  • 2008년 8월 13일 수요일 오후 2:39Scott Piegdon 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     코드 있음
    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

  • 2008년 8월 15일 금요일 오전 10:19nobugzMVP, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    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.
  • 2008년 10월 7일 화요일 오전 10:33Dickie Howarth 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    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.
  • 2008년 10월 8일 수요일 오전 3:34sm0kkie 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    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?
    • 편집됨sm0kkie 2008년 10월 8일 수요일 오전 3:36
    •  
  • 2008년 10월 9일 목요일 오후 1:47Michael Bird from Sharp Dudes 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
     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.
  • 2008년 10월 10일 금요일 오전 12:14Tim ChenMSFT사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

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

    Tim