views:

29

answers:

2

Hi All,

I am having a strange issue when building assembly's for one of my modules.

I was getting errors when running on 64bit which I traced back to being related to the assembly being 32bit specific. Our modules are(or should) all be built to be bit agnostic.

Running CorFlags.exe on the assembly showed the following.


Version : v2.0.50727

CLR Header: 2.5

PE : PE32

CorFlags : 11

ILONLY : 1

32BIT : 1 <-- Note the 32bit flag set to one!

Signed : 1


However I then went back to rebuild the module and just so happened to build in debug mode. (Note: this is the simplified version of the story missing out the hours of solution testing, googling and a fight with a dragon :D)

This time when I checked CorFlags.exe it gave the following:


Version : v2.0.50727

CLR Header: 2.5

PE : PE32

CorFlags : 9

ILONLY : 1

32BIT : 0

Signed : 1


So now I am confused, having torn apart the visual studio build configs and found them to be exactly the same (i.e. all set to "Any CPU") I am now at a loss as to how to fix this.

What would cause this behaviour?

A: 

I am not sure what's causing this behavior but here is a possible workaround:

Have you tried running CorFlags with /32BIT- flag to clear the 32BIT flag from the assembly? If it work you can add a postbuild step to cleat that flag.

Giorgi
Although this would probably fix the problem at a high level, I am sure that there must be a root cause of the problem and I would really like to discover what it is before the system is deployed. Thanks for your suggestion though :)
Jambobond
+1  A: 

Build + Configuration Manager, select Release in the upper left combo. Close. Now use Project + Properties, Build tab and verify Platform Target.

Hans Passant
Yeah I found the option it was located in >>Project Properties -> Compile -> Advanced Compile options.>>Target CPU = AnyCPUcheers tho :)
Jambobond