64-bit Version of Microsoft.Practices.ObjectBuilder2.dll

Topics: Building and extending application blocks, Enterprise Library Core, General discussion
Jan 22, 2009 at 4:38 PM
Hi!

I'm using Microsoft Enterprise Library 4.1.  I re-built the whole library using x64 as Target Platform.  When I run it on  64-bit machine, the Process Explorer shows all Microsoft Enterprise Library DLLs loaded as 64-bit, however, Microsoft.Practices.ObjectBuilder2.dll & Microsoft.Practices.Unity.dll is loaded as 32-bit image.  Is there a 64-bit image of these 2 dlls?
Jan 22, 2009 at 5:12 PM
Hi,

You can just download Unity Application Block 1.2 in http://www.microsoft.com/downloads/details.aspx?FamilyID=2C8B79E7-AE56-4F90-822E-A1E43C49D12E&displaylang=en, install it, open the source code and re-build it targeting x64 platform. Just like what you did with Enterprise Library.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com
Jan 22, 2009 at 8:36 PM
Thanks a lot.  It's worked.
Jan 23, 2009 at 12:34 AM
Hi!

I got an issue with ObjectBuilder2 built as x64 target platform after downloading above code.  I tried using it with Data block built as x64 target platform and got the following exception.  The same Data block worked with 32-bit version of ObjectBuilder.


The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory' threw an exception.


It didn't tell anything more about the exception.  Any idea, what may be wrong?
Jan 23, 2009 at 2:23 AM
Please check if there's an inner exception.  By the way, just to make sure, did you add reference to the ObjectBuilder assembly to the project from which the exception is being thrown?  'Coz most of the post that I've read (not here in codeplex) having the same issue just missed adding reference to it.


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com
Jan 23, 2009 at 4:37 AM
Hi!

I'm developing a C# WinForm project (say MyProject) on a Windows XP Professional 32-bit machine in Visual Studio 2008 for .Net Framework 3.5.  In the project, I make a reference to 32-bit version of "Microsoft.Practices.EnterpriseLibrary.Data.dll", "Microsoft.Practices.EnterpriseLibrary.Common.dll" and "Microsoft.Practices.ObjectBuilder2.dll".  However, for deployment, I re-build all these projects on the same Windows XP Professional 32-bit machine but with target platform as x64.  When I deploy it on Windows Server 2003 SP3 64-bit machine, following occurs.

********* Everything works well if I put following files *********************
Assembly                                                                                            Built with Target Platform as
---------                                                                                            ------------------------------
MyProject.exe                                                                                                x64 (loads as 64-bit image)
Microsoft.Practices.EnterpriseLibrary.Data.dll                                                x64 (loads as 64-bit image)
Microsoft.Practices.EnterpriseLibrary.Common.dll                                        x64 (loads as 64-bit image)
Microsoft.Practices.ObjectBuilder2.dll                                                           Any CPU  (loads as 32-bit image)

********* I get the error mentioned in previous post if I put following files *********************
Assembly                                                                                            Built with Target Platform as
---------                                                                                            ------------------------------
MyProject.exe                                                                                                x64 (loads as 64-bit image)
Microsoft.Practices.EnterpriseLibrary.Data.dll                                                x64 (loads as 64-bit image)
Microsoft.Practices.EnterpriseLibrary.Common.dll                                        x64 (loads as 64-bit image)
Microsoft.Practices.ObjectBuilder2.dll                                                           x64 (does not load at all due to above exception)

Jan 27, 2009 at 1:20 AM
Let me go back a bit here, won't the assemblies (Data and ObjectBuilder2) build with "Any CPU" as target platform won't work?  Sorry, I can't try this as I don't have a 64-bit machine.  As far as I know, assemblies built on any cpu target platform will work in either 32 or 64 bit machine. 


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com
Jan 27, 2009 at 2:43 AM
Hi Sarah!

May be you didn't get my problem.  The ObjectBuilder2 built with "Any CPU" on 32-bit machine, runs as 32-bit image on 64-bit machine.  Our application uses a lot of memory and we want full use of 64-bit machine.  However, because of ObjectBuilder2 running as 32-bit image restrict this use.  If I build ObjectBuilder2 as x64 Target Platform, then it doesn't run on 64-bit machine.  If ObjectBuilder2 does not run as 64-bit image on 64-bit machine then we've to see other solutions.   Microsoft Enterprise Library is useless for us in this case.
Jan 27, 2009 at 3:07 AM
Edited Jan 27, 2009 at 3:32 AM
Oh I see, I originally thought that the 32-bit image really didn't worked on your 64-bit image.  So it works but there's just restrictions that you dont want.  Did you checked if there's any InnerException?  It's difficult to guess what's the exact problem.

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com
Jan 28, 2009 at 6:49 PM
Edited Jan 28, 2009 at 6:51 PM
Hi Sarah!

I can't check InnerException because it happens only on 64-bit machine where I don't have Visual Studio installed.  I develop on 32-bit machine and build for 64-bit Target Platform on the same 32-bit machine.  But this 64-bit Microsoft.Practices.ObjectBuilder2.dll gives the exceptions I mentioned above.  You told that you don't have 64-bit machine to test this scenario.  How can we figure out then what's wrong?  My company doesn't allow me to install Visual Studio on that 64-bit machine where they want it to deploy.  Any more ideas?
Jan 29, 2009 at 10:10 AM
I don't have a 64-bit machine so the least I could do is try to google up some answers for you.  The only idea in my mind now is the difference in the environment you're running it in.  Isn't Windows Server 2008 more like Vista rather than XP when it comes to default permissions?  


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com