Charrette
Charrette

Reputation: 720

"Could not load file or assembly Kitware.VTK" when using x64 version of Kitware.VTK

I'm using Kitware.VTK x86 since I started using this library because I've never been able to make the x64 version works. Now I'd like to understand why.

With the x64 version, as soon as I start using a VTK class, I get the following error:

enter image description here

Sorry for french langage, the error is simply "Could not load file or assembly Kitware.VTK"

Here is the only code I wrote to rise this exception:

    public MainWindow()
    {
        InitializeComponent();

        RenderWindowControl renderer = new RenderWindowControl();
    }

Again, everything works well with x86 version. But I'm starting to have other problems later in my code with this library, so in a fit of despair, I just hope that being able to switch to the x64 version will fix all my problems !

Edit:

In the InnerException details there's also this error : "Trying to load an incorrect format program."

Upvotes: 1

Views: 685

Answers (1)

Charrette
Charrette

Reputation: 720

Thanks to @sthotakura, I've been looking to the value of the active plateforme of the application, which was set to Any CPU. I tried to set it to x64, and it's working well.

I still don't understand why I had to do this, but at least it's working..

Upvotes: 1

Related Questions