RobotStudio event

Why is there exception runtime

Options
System.TypeInitializationException was unhandled
  Message="The type initializer for 'ABB.Robotics.Controllers.Internal.NetworkScanner' threw an exception."
  Source="ABB.Robotics.Controllers"
  TypeName="ABB.Robotics.Controllers.Internal.NetworkScanner"
  StackTrace:
       at ABB.Robotics.Controllers.Internal.NetworkScanner.get_Instance()
       at ABB.Robotics.Controllers.Discovery.NetworkScanner..ctor()
       at ControllerAPI.Create.DynamicCreation() in C:abbpc interfaceControllerAPIControllerAPICreateControllerCreate.cs:line 64
       at ControllerAPI.Create.Main(String[] args) in C:abbpc interfaceControllerAPIControllerAPICreateControllerCreate.cs:line 55
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.BadImageFormatException
       Message="Could not load file or assembly 'ABB.Robotics.Adapters.IRC5, Version=5.14.3070.3, Culture=neutral, PublicKeyToken=1da709b7d1f14b7b' or one of its dependencies. An attempt was made to load a program with an incorrect format."
       Source="ABB.Robotics.Controllers"
       FileName="ABB.Robotics.Adapters.IRC5, Version=5.14.3070.3, Culture=neutral, PublicKeyToken=1da709b7d1f14b7b"
       FusionLog="=== Pre-bind state information ===
LOG: User = ASIAPACIFIC\CNZIQI
LOG: DisplayName = ABB.Robotics.Adapters.IRC5, Version=5.14.3070.3, Culture=neutral, PublicKeyToken=1da709b7d1f14b7b
(Fully-specified)
LOG: Appbase = file:///C:/abb/pc interface/ControllerAPI/ControllerAPI/CreateController/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : ABB.Robotics.Controllers, Version=5.14.3070.0, Culture=neutral, PublicKeyToken=1da709b7d1f14b7b.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Post-policy reference: ABB.Robotics.Adapters.IRC5, Version=5.14.3070.3, Culture=neutral, PublicKeyToken=1da709b7d1f14b7b
LOG: Attempting download of new URL file:///C:/abb/pc interface/ControllerAPI/ControllerAPI/CreateController/bin/Debug/ABB.Robotics.Adapters.IRC5.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
"
       StackTrace:
            at ABB.Robotics.Controllers.Internal.NetworkScanner..ctor()
            at ABB.Robotics.Controllers.Internal.NetworkScanner..cctor()
       InnerException:

Comments

  • John Wiberg
    Options


    We really need more info than just the stack.
     
    Is this PCSDK? If not then which SDK are you using?
     
    What command is executing when you get this error?
     
    Is this during developement or a deployed application?
     
    etc. The more surrounding info the more we will be able to help you.
     
    Now, just by going on the error message "Could not load file or assembly  'ABB.Robotics.Adapters.IRC5, Version=5.14.3070.3" I'd ask you to check out which version of RobotWare the controller has, and which version do you have installed with the APP.
  • zijiang
    Options

    webwiz/2128/CreateController.zip  

     pc sdk 5.14

     

    image
  • zijiang
    Options

    Robotware version  :RW5.14_03.01.3071


  • I have the very same problem, using the 5.13 version of the dlls. The funny thing is that it works on my Win7 32bit machine, but fails on the WinXP machine. I'm very thrilled to find a solution to this problem.

    EDIT: Oh dear. I had only installed the SDK. Installing the whole RobotStudio fixed the issue for me!
    CaptainAwesome2012-09-21 13:16:53
  • Make sure that you are building a 32-bit executable, by specifying x86 as the platform target in the VS project settings. 


    If AnyCPU is specified, and you execute the application on a 64bit OS, a 64bit process will get started. Parts of PC SDK are implemented in COM (native code) which is not built for 64bit. The inner exception of the exception in your stack trace is a bad image format exception caused by the fact that a 32 bit assembly is attempted to get loaded into a 64 bit process.

    On a 32 bit OS there are only 32 bit processes and this mismatch can not happen.

    Please note that a 64 bit OS can run a 32 bit process, but not the opposite. That is why all your good old applications that you had on your 32 bit machine continues to function when you double your bits and go 64 Lamp?

    Best Regards, Niklas Skoglund
    ABB Robotics

    Developer Center
    RobotStudio Blog
  • andyong
    Options
    Make sure that you are building a 32-bit executable, by specifying x86 as the platform target in the VS project settings. 


    If AnyCPU is specified, and you execute the application on a 64bit OS, a 64bit process will get started. Parts of PC SDK are implemented in COM (native code) which is not built for 64bit. The inner exception of the exception in your stack trace is a bad image format exception caused by the fact that a 32 bit assembly is attempted to get loaded into a 64 bit process.

    On a 32 bit OS there are only 32 bit processes and this mismatch can not happen.

    Please note that a 64 bit OS can run a 32 bit process, but not the opposite. That is why all your good old applications that you had on your 32 bit machine continues to function when you double your bits and go 64 Lamp?
    I have the same problem as zijiang.And I have specified x86 as the platform target in the VS project settings,but the problem still exities .
  • andyong
    Options
    i have the same problem .i solved it by two steps:
    firstly,robotstudio must be installed.secondly,you must specify x86 as the platform target in the VS project settings. 
  • baijun
    Options
    andyong said:
    i have the same problem .i solved it by two steps:
    firstly,robotstudio must be installed.secondly,you must specify x86 as the platform target in the VS project settings. 
    Hi andyong ,I have the same problem as zijiang.I do as you approach, the problem remains unresolved.
  • baijun
    Options
    Make sure that you are building a 32-bit executable, by specifying x86 as the platform target in the VS project settings. 


    If AnyCPU is specified, and you execute the application on a 64bit OS, a 64bit process will get started. Parts of PC SDK are implemented in COM (native code) which is not built for 64bit. The inner exception of the exception in your stack trace is a bad image format exception caused by the fact that a 32 bit assembly is attempted to get loaded into a 64 bit process.

    On a 32 bit OS there are only 32 bit processes and this mismatch can not happen.

    Please note that a 64 bit OS can run a 32 bit process, but not the opposite. That is why all your good old applications that you had on your 32 bit machine continues to function when you double your bits and go 64 Lamp?
    Hi Niklas Skoglund ,thank you for your attention.I am new in using PC SDK,failed in initialization of NetworkScanner class ,my project is set to X86, ABB.Robotics.Controllers.PC.dll version 6.3.7016.2009, the same as Robot Communication Runtime. May I ask you, what is the problem and what is the solution, thank you very much