This is a migrated thread and some comments may be shown as answers.

Error compiling x64 assembly

4 Answers 111 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mark
Top achievements
Rank 1
Mark asked on 22 Jul 2013, 06:44 PM
I am using OpenAccess (version 2013.2 611) in a solution with several projects.  When I try to set the Platform Target on all of my projects to x64, my OpenAccess project is the only one that throws an error. 
This is the error below. How can I get an OpenAccess project to compile in x64?

Thanks


Error 37 The specified assembly 'C:\Users\xxx\AppData\Local\Temp\_ptil_5728\Dfa.Dal.dll' cannot be loaded. The problem might be that the enhancer runs in a .NET framework 2.0 vm and the assembly to enhance is a .NET 4.0 assembly or you are trying to enhance a x86 assembly in a 64 bit process or a x64 assembly in a 32 bit process. Please change the required version inside the enhancer.exe.config or venhance.exe.config or switch to 'Any CPU' for this project. C:\TfsProjects\DFA\Dev\Trunk\Dfa.Dal\obj\Debug\Dfa.Dal.dll Dfa.Dal

4 Answers, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 23 Jul 2013, 07:10 AM
Hello Mark,

The problem is that the Visual Studio compilation process is 32 bit and our enhancer msbuild task cannot read the 64 bit assemblies if it is started within a 32 bit environment. There are two ways to resolve the problem, the first is to start the enhancer in a separate process by including a command line call to enhancer.exe in the openaccess.targets file or you keep the assembly with the persistent classes as "Any Cpu" assembly. As the compiler does not compile it differently and the referencing assemblies are forcing your app to run in 64 bit anyways, I do not see any impacts.

Regards,
Jan Blessenohl
Telerik
OpenAccess ORM Q2 2013 brings you a more powerful code generation and a unique Bulk Operations support with LINQ syntax. Check out the list of new functionality and improvementsshipped with this release.

0
Mark
Top achievements
Rank 1
answered on 23 Jul 2013, 02:29 PM
 Any Cpu isn't an option for me. I need it to be x64.,
So can you please give me some detailed instructions on how to do the enhancer.exe?  Is that just modifying the openaccess.targets file?  
0
Jan Blessenohl
Telerik team
answered on 23 Jul 2013, 03:19 PM
Hello Mark,
why is Any CPU not an option for you? If you just use Any CPU for this single assembly, nothing will be different.

Can you tell me how you work with OpenAccess, Designer with XML, attribute or fluent mapping or without designer with fluent mapping only?

Regards,
Jan Blessenohl
Telerik
OpenAccess ORM Q2 2013 brings you a more powerful code generation and a unique Bulk Operations support with LINQ syntax. Check out the list of new functionality and improvementsshipped with this release.

0
Mark
Top achievements
Rank 1
answered on 26 Jul 2013, 03:43 PM
I was working with a third party tool called ActiveBatch.  We thought it had to be compiled as x64. AnyCPU did end up working. 

Thanks


Tags
Data Access Free Edition
Asked by
Mark
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Mark
Top achievements
Rank 1
Share this question
or