wliao008 / buffalo

an aspect oriented programming framework using mono cecil for the .NET platform
1 stars 0 forks source link

Release build weirdness #19

Closed wliao008 closed 11 years ago

wliao008 commented 11 years ago

In this test both Buffalo.dll, BuffaloAOP.exe and client.exe are the release build.

c:\Temp\Buffalo>BuffaloAOP.exe "C:\Users\Wei.Liao\Documents\Visual Studio 2012\P rojects\buffalo\client\bin\release\client.exe"

Unhandled Exception: System.BadImageFormatException: Could not load file or asse mbly 'file:///C:\Users\Wei.Liao\Documents\Visual Studio 2012\Projects\buffalo\cl ient\bin\release\client.exe' or one of its dependencies. An attempt was made to load a program with an incorrect format. at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String cod eBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntro spection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName as semblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMar k& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIn trospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName as semblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMar k& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean sup pressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Ev idence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackM ark) at System.Reflection.Assembly.LoadFrom(String assemblyFile) at Buffalo.BoundaryObject.DoSomething(AppDomainArgs ada, String path) at Buffalo.Weaver.SetUnderlyingAspectTypes() at Buffalo.Weaver.Init() at BuffaloAOP.Program.Main(String[] args)

wliao008 commented 11 years ago

debug build can inject release build "client.exe" with no problem. for release build BuffaloAOP to work, I had to change the build target of client.exe to "Any CPU", to match that of BuffaloAOP and buffalo.dll.