Error compiling x64 assembly

5 posts, 0 answers
  1. Mark
    Mark avatar
    4 posts
    Member since:
    Apr 2011

    Posted 22 Jul 2013 Link to this post

    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

  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 23 Jul 2013 Link to this post

    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.

  3. DevCraft banner
  4. Mark
    Mark avatar
    4 posts
    Member since:
    Apr 2011

    Posted 23 Jul 2013 Link to this post

     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?  
  5. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 23 Jul 2013 Link to this post

    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.

  6. Mark
    Mark avatar
    4 posts
    Member since:
    Apr 2011

    Posted 26 Jul 2013 Link to this post

    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


Back to Top
DevCraft banner