This question is locked. New answers and comments are not allowed.
I have a class library with persistent classes using the latest release of OpenAccess. Previously I had a script to execute VEnhance on this assembly from the command-line to facilitate automated build process. This worked very well.
I recently migrated to Visual Studio 2010 and switched the framework target of my persistent classes library to .Net 4.0. Building this project within Visual Studio and allowing OpenAccess to Enhance and UpdateDatabase works just fine. However, the command-line call to VEnhance now produces an exception.
If I switch the target framework of my persistent classes library back to v3.5 or below then the command-line call to VEnhance works perfectly.
What can I do to get the VEnhance tool to work correctly with a v4.0 framework assembly?
Here is what I am executing at the command-line:
"c:\program files\telerik\openaccess orm\sdk\VEnhance.exe" -assembly:C:\Develop\DotNet\KSS.Data\KSS.Data.Model.WM\obj\Debug\KSS.Data.Model.WM.dll -config:C:\Develop\DotNet\KSS.Data\KSS.Data.Model.WM\App.config -debug+ -verbose+
Here are the contents of the exception:
Error executing VEnhance! Output: Telerik OpenAccess Enhancer, Version 2010.1.312.2
Copyright (C) 1996-2010 Telerik
The specified assembly 'C:\Documents and Settings\xxxxxx\Local Settings\Temp\_ptil_3772\KSS.Data.Model.WM.dll' cannot be loaded. The problem might be that the platform target is set to x64 or itanium. Only x86 is supported now.
at Telerik.OpenAccess.Sdk.Enhancer.Enhancer.CrossDomainRunImpl(AssemblyLoader assemblyLoader)
at Telerik.OpenAccess.Sdk.Enhancer.EnhancerBase.CrossDomainRun()
at Telerik.OpenAccess.Sdk.Enhancer.EnhancerBase.DomainRun(Boolean createDomain)
at Telerik.OpenAccess.Sdk.Enhancer.Enhancer.Start(EnhancerSettings _settings)
at Telerik.OpenAccess.Sdk.Enhancer.Enhancer.ConsoleRun(EnhancerSettings settings)
InnerException:
Could not load file or assembly 'file:///C:\Documents and Settings\xxxxxx\Local Settings\Temp\_ptil_3772\KSS.Data.Model.WM.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Telerik.OpenAccess.Sdk.Enhancer.Enhancer.CrossDomainRunImpl(AssemblyLoader assemblyLoader)
Error:
Unhandled Exception: Telerik.OpenAccess.Sdk.Enhancer.EnhancerException: The specified assembly 'C:\Documents and Settings\xxxxxx\Local Settings\Temp\_ptil_3772\KSS.Data.Model.WM.dll' cannot be loaded. The problem might be that the platform target is set to x64 or itanium. Only x86 is supported now. ---> System.BadImageFormatException: Could not load file or assembly 'file:///C:\Documents and Settings\xxxxxx\Local Settings\Temp\_ptil_3772\KSS.Data.Model.WM.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
File name: 'file:///C:\Documents and Settings\xxxxxx\Local Settings\Temp\_ptil_3772\KSS.Data.Model.WM.dll'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Telerik.OpenAccess.Sdk.Enhancer.Enhancer.CrossDomainRunImpl(AssemblyLoader assemblyLoader)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
--- End of inner exception stack trace ---
at Telerik.OpenAccess.Sdk.Enhancer.Enhancer.CrossDomainRunImpl(AssemblyLoader assemblyLoader)
at Telerik.OpenAccess.Sdk.Enhancer.EnhancerBase.CrossDomainRun()
at Telerik.OpenAccess.Sdk.Enhancer.EnhancerBase.DomainRun(Boolean createDomain)
at Telerik.OpenAccess.Sdk.Enhancer.Enhancer.Start(EnhancerSettings _settings)
at Telerik.OpenAccess.Sdk.Enhancer.Enhancer.ConsoleRun(EnhancerSettings settings)
at Telerik.OpenAccess.Tools.Enhancer.Main(String[] args)