Page 1 of 1

Deployment to 64 bits

Posted: Tue Feb 02, 2010 11:09 am
by 13046963
Good morning,

I was wondering if you could point me how we can:
1 - Use TChart 3 on our dev machine (Vista 32 bits - VS 2008)
2 - Deploy 64 bits versions for some Application & Services
3 - Deploy 32 bits versions for another set of Application & Services.

So far I have installed the 32 bits and the 64 "build only" versions on my dev machine. I can compile and run it on my dev machine in 32 bits mode with no problem.
To deploy I have tried to copy all the application dlls and files including the TeeChart 64 build dlls to a 64 bits box. On start I get an assembly mismatch error:
Could not load file or assembly 'TeeChart, Version=3.5.3065.19162, Culture=neutral, PublicKeyToken=9c8126276c77bdb7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
If I copy the default TeeChart DLL for 32 bits it seems to work fine. The Windows Task Manager still refers to our application as 64 bits.

As a result we have the feeling that we are missing something important here.

So the questions are:
1 - Does it matter which version we deploy as long as we do not use the OpenGL features?
2 - Is there actually any problem running the "32" bits version of the Tchart in 64 bits to produce contour maps and simpler line/box plot series (Our application uses more than 2 GB of RAM in live environment, we really need the memory available to 64 bits processes)
3 - What do we need to do to deploy the 64 bits TeeChart dll if needed - I cannot find any documentation or FAQ that explains this?

Many thanks.
Regards,
Michael M.

Re: Deployment to 64 bits

Posted: Tue Feb 02, 2010 1:15 pm
by narcis
Hi Michael,

To begin with this I recommend you to read tutorial 17. Tutorials can be found at TeeChart's program group. The error message you posted indicates that the application couldn't find the assembly it was compiled with.
1 - Does it matter which version we deploy as long as we do not use the OpenGL features?
The only difference is that if you want to build native 64-bit applications you'll need to build your applications with x64 build of TeeChart.dll. Notice that x64 assembly is a runtime only assembly. This means you won't be able to use at designtime. You can do your development with the x86 versiond and build your applications with the x64 assembly for deployment.
2 - Is there actually any problem running the "32" bits version of the Tchart in 64 bits to produce contour maps and simpler line/box plot series (Our application uses more than 2 GB of RAM in live environment, we really need the memory available to 64 bits processes)
The only 64-bit related problem I can think of is this one: http://www.teechart.net/support/viewtopic.php?t=9763
3 - What do we need to do to deploy the 64 bits TeeChart dll if needed - I cannot find any documentation or FAQ that explains this?
Sames as deploying x86 applications but building the applications with x64 assembly as I told you in my reply to question number 1.

Re: Deployment to 64 bits

Posted: Tue Feb 02, 2010 3:17 pm
by 13046963
Thanks,
You can do your development with the x86 versiond and build your applications with the x64 assembly for deployment.
This is exactly what I am trying to do without having to change the references of the TeeChart assembly for the various DLL and exe every single time I need to deploy the various applications. But it seems from your suggestion that this would not be possible without every time changing the references in the various projects and dlls.

Since the normal Teechart dll seems to have been compiled with the "Any CPU" attribute, since otherwise, it would not have worked when I did my test on a 64 bits machine, with my app compiled with the "Any CPU" flag on, the Task Manager reporting it as a 64 bits app and the app still working when using over 3GB of RAM. It seems to me that we should not bother with the TChart version specific to x64 in our case - unless we are missing something.

so my questions are simple:
- As we do not use OpenGL, do we really need to run the x64 bits build version in our 64 bits application? My test says NO so far. I am looking for a clear answer.
- If we really should use the x64 bits dll would you know how we can compile with the various version of the TChart without having everytime to change the reference to the DLL in all the assemblies it is used?

Many thanks,
Michael M.

Re: Deployment to 64 bits

Posted: Tue Feb 02, 2010 3:43 pm
by narcis
Hi Michael,
- As we do not use OpenGL, do we really need to run the x64 bits build version in our 64 bits application? My test says NO so far. I am looking for a clear answer.
There's no problem with using x86 assembly as you suggest. It will work under WOW64 though. For more information please read this:

http://msdn.microsoft.com/en-us/library/ms241064.aspx

Re: Deployment to 64 bits

Posted: Tue Feb 02, 2010 5:57 pm
by 13046963
From the MSDN:
WOW64 is a compatibility environment provided by the operating system that allows a 32-bit application to run on a Windows 64-bit operating system.
...
As with 32-bit Windows operating systems, there is a 2GB limit on the size of an object
I am sorry but I am going to repeat myself here as it seems you believe my app runs as a 32 bits app when I am 100% convinced otherwise.
My application is marked as 64 bits by windows and not as "blablabla *32" we see for all 32 bits App that run under WOW64, it uses more than the 2GB limit of 32 bits happily. The final proof if you need is that the size of the IntPtr is 8 Bytes and not 4 Bytes. That means for certain it is running as a 64 bits app.

So to me that application is NOT running as a 32 bits app. So my understanding is that it does NOT use WOW64.

And this is fine as long as that application or a dll is NOT using INTEROP through either a 32 bits COM Dll or making direct call to 32 bit standard dlls as an example. At that point it would blow up when the call is made or slightly later on most often in an unpredictable way. I have a long experience with those problems and understand them well.

So essentially:
1 - Does the TeeChart dll make any call to the Windows API dll using Interop or not?
2 - Does the TeeChart DLL use UNSAFE CODE or MEMORY MAPPING or what not code that would make it unsafe to run in a 64 bits process?

Please simply answer a YES or NO to these two questions. This is what I need to know for sure from you. I do not need any reference to the MSDN or any other site. Just a Yes or No would suffice me. Unless you know a way of compiling using the 64 bits of your dll without the pain of having to go through all the assemblies where it is referenced every time when I need to deploy for the various environment.

So far, despite what you seem to be thinking it just run fine as a 64 bits (I am not touching the OpenGL in which case I am sure it would blow up for sure).

Many thanks for your help.
Michael M.

Re: Deployment to 64 bits

Posted: Wed Feb 03, 2010 8:17 am
by narcis
Hi Michael,
1 - Does the TeeChart dll make any call to the Windows API dll using Interop or not?
2 - Does the TeeChart DLL use UNSAFE CODE or MEMORY MAPPING or what not code that would make it unsafe to run in a 64 bits process?
No to both of them. TeeChart for .NET is 100% written with managed C# and doesn't use any Interop call.
Unless you know a way of compiling using the 64 bits of your dll without the pain of having to go through all the assemblies where it is referenced every time when I need to deploy for the various environment.
If TeeChart's AssemblyFolders entry in the building machine points to the x64 assembly and it's not copied in projects "bin" folder projects should automatically use it.

Hope this helps!