There was a project a few days ago. After the development on the local machine is complete, because the data volume is too large, you wantProgramMigrating to the server for testing, but who knows that the three servers have been replaced, and the following errors have been encountered consecutively, which makes it difficult for a group of people.
Error message:
the system. typeinitializationexception
message = "" test. Program "type initializationexception is not handled, causing an exception. "
source =" test "
typename =" test. program "
stacktrace:
in test. program. main ()
in system. appdomain. _ nexecuteassembly (Assembly, string [] ARGs)
in Microsoft. visual Studio. hostingprocess. hostproc. runusersassembly ()
in system. threading. executioncontext. run (executioncontext, contextcallback callback, object state)
in system. threading. threadhelper. t Hreadstart ()
innerexception: system. runtime. interopservices. comexception
message = "failed to retrieve components whose CLSID is {E01BE902-CC85-4B13-A828-02E789E0DDA9} in the com class factory because of the following error: 80040154 . "
Bytes ------------------------------------------------------------------------------------------------------------
I always thought that the installation version of the engine was inconsistent with the version of other ArcGIS products on the machine. However, I finally moved to a server without the ArcGIS product installed. the problem persists. Vs debugging found that the above error is reported starting from the entry of the program to check the license file. What is the cause of this problem when the arcengine operating license is confirmed to be available? Finally, in ESRI's supports found the relevant information, the source URL is http://forums.esri.com/thread.asp? C = 159 & F = 1707 & t = 219248 & Mc = 6
Solution:
TheArcObjects COM components can't be loaded by a 64-bit. Net app andTheDefault compilation of a new project is for "any CPU." CheckTheBuild tab underTheProject Properties and setThePlatform targetToX86.
Right click onTheTop icon inTheSolution Explorer and selectTheProperties entry inTheContext menu. InTheProperties page, selectTheCompile TabTo TheLeft, then clockTheAdvanced compile options button. This will bring upTheAdvanced compiler Settings dialog.TheLast entry inTheDialog isTheTarget CPU ComboBox, which defaultsTo TheValue anycpu. change thatToX86 and click OK.
This will solveTheProblems that manifest as an innerexception when you tryToLaunchTheAPP:
Error number: "-2147221164"
Message: "retrievingTheCom class factory for component with clsid {E01BE902-CC85-4B13-A828-02E789E0DDA9}Failed Due To The Following Error: