Click here to Skip to main content
15,847,427 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi, everybody.

I am new to WF and this forum. I have several questions.

First and most important is: does workflow foundation have full support for x64 platforms?

I have other questions and i'm not sure if they are related to title and if i shoud ask them here. As i said I am new to this (and other) forums. I have encountered several problems right at the start of my work. I am using VS Professional&& 2013 and i have existing project (which is one of the workflow project types) built for x64 platform and target framework is .NET 4.5.1 and my job is to replace existing implementation of something with WF implementation.

When i add new activity to my existing project and activity designer is opened, build fails and explanation i get is that .exe file i'm trying to build is used by another process. When i close designer build is successful. Why is that?

When i add some argument and try to select custom type by choosing 'Browse for Types' from combo box that is located under designer surface, I dont get my custom classes as options. But when I click 'Browse for Types' from combo box that is located on the property panel in the bottom right corner i get my custom classes as options. Why is that?

And last question. When i select custom class as type for argument or variable and click "Ok" button, i get "BadImageFormatException: Could not load file or assembly 'Foo, Version=1.0.0, Culture=Neutral, PublicKeyToken=Something' or one of its dependencies. An attempt was made to load program with an incorrect format
at System.Reflection.RuntimeAssmebly._nLoad...". Why is that?

Sorry for off topic questions and grammar mistakes.



1 solution

Not enough information. But you should understand certain things. You should never ever mix different target platforms in one process. All platforms can be freely combined only with "AnyCPU". AnyCPU is the most usable target which you should use in almost all cases. It is possible because it is based on JIT compilation which happens during runtime. Any concrete platforms can be used only because of some dependency on some unmanaged executable module. If such modules are not used, all targets should be "AnyCPU".

Also, you should know that there are at least two different 64-bit targets incompatible with each other: x86-64 (also called AMD64) and IE-64 (also called "Itanium"). If, by some reason, you are trying to use an assembly which comes without source code and is targeted to "Itanium", you won't be able to use it on your system, if it has physical x98-64 CPU, no matter what you do, even if you install a x86 (32-bit) OS on it. But all physical CPU architectures are compatible with x86. Please see:[^],[^],[^],[^].

One more thing you should know is this:[^].

You can use any x86-targeted assemblies on your 64-bit system (reportedly, it works purely on Itanium, but I personally did not try), but you still cannot mix-up any different concrete architectures.

Share this answer
Dile90BJ 27-Aug-14 5:22am    
Hi, Sergey.

Thank you for your answer. Using AnyCPU as target platform solves some of my problems. However, i have to use x86-64 as target platform. Its not my decision. All other assemblies use that platform. And it works until i add some workflow activity into my project. Any help?

Sergey Alexandrovich Kryukov 27-Aug-14 11:06am    
First of all, it's not clear what does it mean, "have to use x86-64 as a target platform". How can it be a requirement, in principle?

If this is a requirement to use corresponding compilation flag, the problem is already solved: set this flag to x64, that's it. And having it working will be the problem of the one who created that "requirement", not you. Isn't it logical?

Now, let's say, you a library assembly L.DLL and application A.EXE, using L.DLL. Say, A.EXE is compiled to x86-64, and L.DLL to AnyCPU. It means that L.DLL will work as x86-64 if loaded (say, referenced) by A.EXE, but it may also work as x86 if referenced by something else. Anyway, in A.EXE application, L.DLL will work as x86-64. It is "targeted" as x86-64 or not?

No matter how you call it, no matter who "decides" what. If someone gives you "decisions", let this person "decide" a sun to rise early. Or let them talk to me.

Anyway, it does not even worth discussion. I explained you how things work. I don't know what set of modules do you have, how are they targeted and why. I can only assume that you want them to work. It's up to you to use this knowledge. You already got all help related to the question you formulated. Please use it. If you have some follow-up questions, they will be welcome. Consider accepting the answer formally (green "Accept" button).

Good luck,
Dile90BJ 27-Aug-14 14:56pm    
Thank you, Sergey. I know i may be stubborn. Yes, I have to put x64 as a target platform in a property file of project. And it causes me troubles. So i thought to find some workaround. However, I guess i have to use AnyCPU. Once again, thank you for your patience.
Best regards,
Sergey Alexandrovich Kryukov 27-Aug-14 15:59pm    
Again, I have no information on the set of modules you have, 3rd-parties, etc, which ones you cannot modify and which ones you cannot. Also, you never explained what "have to put x64 as a target platform in a property file of project" really means. In what sense you my "have" or not "have" it. It's not because it's false or true, this is because this phrase along means nothing. If you provide more information, I'll certainly be able to give you more specific answer, but, honestly, the information I already provided should be enough. If not, you can just ask some follow-up question.
Dile90BJ 27-Aug-14 16:09pm    
'Have to' as 'Must'. Company policy. They 'recommend' (read that as 'you must') using x64, and not AnyCPU as target platform. Every module is built for that target platform. Regardless of having 3rd-parties or not. I'm just a beginner and english is not my native language, so i may not express myself the way i want to.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900