PC SDK Compability Issues
John Wiberg
✭✭✭
PC SDK compability issues
If you are getting:
[quote]TypeInitializationException was unhandled
The type initializer for 'ABB.Robotics.Controllers.Internal.ControllerManager' threw an exception.
InnerException: System.IO.FileLoadException
Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.[/quote]
or
[quote]BadImageFormatException was unhandled
The type initializer for 'ABB.Robotics.Controllers.Internal.ControllerManager' threw an exception.
InnerException: System.BadImageFormatException
Could not load file or assembly 'ABB.Robotics.Adapters.IRC5, Version=5.xx, Culture=neutral, PublicKeyToken=xx' or one of its dependencies. An attempt was made to load a program with an incorrect format.[/quote]
Then this is for you.
Background
At the core of the controller communication of the PC SDK there is some old managed code created in the days when the IRC5 was new. ABB is working on replacing it but is not there yet. This means that in the mean time the PCSDK does not yet come in a 64-bit nor a .NET 4 version. Instead it is built for 32bit and with .NET Framework 2.
This makes it a bit troublesome for a developer who wants to do a PC SDK Windows form app straight away. This since you need to tell the development environment what to do with this old stuff.Solution for mixing with .NET Framework 4.xUsing the PC SDK dll references together with a newer .NET 4.x project will generate a TypeInitializationException runtime error. You could solve this by downgrading the whole project to a .NET Framework 2 project, but if you need/want those nifty .NET 4 features do this:Right click your project and select Add>New Item.In the dialog select Application Configuration File. In the App.config file you need to add code so that it looks like this:
[code]<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true"></startup>
</configuration>[/code]
Solution for AnyCPU / x64 / x86
Using the PC SDK controller communication on 64bit will generate a BadImageFormatException so you need to tell the project to run x86 exclusively. This means that even if you are running on a 64bit OS it will run the app as a 32bit process.
Right Click the project and select Properties.In the Build tab in the list Platform target: select x86
John
Developer Center
Developer Center
0
Comments
-
John Wiberg said:PC SDK compability issues If you are getting: [quote]TypeInitializationException was unhandled
The type initializer for 'ABB.Robotics.Controllers.Internal.ControllerManager' threw an exception. InnerException: System.IO.FileLoadException
Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.[/quote] or [quote]BadImageFormatException was unhandled
The type initializer for 'ABB.Robotics.Controllers.Internal.ControllerManager' threw an exception. InnerException: System.BadImageFormatException
Could not load file or assembly 'ABB.Robotics.Adapters.IRC5, Version=5.xx, Culture=neutral, PublicKeyToken=xx' or one of its dependencies. An attempt was made to load a program with an incorrect format.[/quote] Then this is for you. Background At the core of the controller communication of the PC SDK there is some old managed code created in the days when the IRC5 was new. ABB is working on replacing it but is not there yet. This means that in the mean time the PCSDK does not yet come in a 64-bit nor a .NET 4 version. Instead it is built for 32bit and with .NET Framework 2. This makes it a bit troublesome for a developer who wants to do a PC SDK Windows form app straight away. This since you need to tell the development environment what to do with this old stuff.Solution for mixing with .NET Framework 4.xUsing the PC SDK dll references together with a newer .NET 4.x project will generate a TypeInitializationException runtime error. You could solve this by downgrading the whole project to a .NET Framework 2 project, but if you need/want those nifty .NET 4 features do this:Right click your project and select Add>New Item.In the dialog select Application Configuration File. In the App.config file you need to add code so that it looks like this:
[code]<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true"></startup>
</configuration>[/code]Solution for AnyCPU / x64 / x86
Using the PC SDK controller communication on 64bit will generate a BadImageFormatException so you need to tell the project to run x86 exclusively. This means that even if you are running on a 64bit OS it will run the app as a 32bit process.
- Right Click the project and select Properties.
- In the Build tab in the list Platform target: select x86
0 -
Hi John Wiberg.
I have a question, ABB dll requires .NET version 4.5, how to downgrade the project to the .NET version 2.0? .NET Downgrade to version 2.0, the compiler will complain. I am by your practice to add the code in the App.config file you mentioned, suggesting that error, I am using VS2013, it has been set for the x86 platform.So much I am looking forward to your reply.
0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 800 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings