referencing mixed platform 3rd party assembly in custom task creation
I'm trying to create some a custom task to interact with our VisualSVN repo using SharpSVN api. I added a reference to the dll. I have one csproj file which all my individual task class files are bound to. It compiles fine, but with following warning.
There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "SharpSvn", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.
Then when I run the task, it is failing with following message
System.IO.FileNotFoundException: Could not load file or assembly 'SharpSvn, Version=1.7002.1998.12257, Culture=neutral, PublicKeyToken=d729672594885a28' or one of its dependencies. The system cannot find the file specified. File name: 'SharpSvn, Version=1.7002.1998.12257, Culture=neutral, PublicKeyToken=d729672594885a28' at XXX.Build.NAnt.CustomTasks.getSVNRevisionListTask.ExecuteTask() at NAnt.Core.Task.Execute() at NAnt.Core.Target.Execute() at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies) at NAnt.Core.Project.Execute() at NAnt.Core.Project.Run()
Per somebody's suggestion in an online forum, I created a dll config file with the following content.
But the problem persists. I also noted that nant.exe.config also has this entry, but without the useLegacyV2RuntimeActivationPolicy setting.
The SharpSVN dll should target win32/x86 platform. Although, I'm trying out the custom task in a widows server 2008 r2 server, I couldn't get the reference to x64 version of the dll to work with a console app, I was trying out earlier, leading me to stick with the x86 version.
Has anybody faced similar issue with referencing assemblies for custom task that may not be compiled with anycpu platform setting. Does NAnt have an intrinsic way to deal with this kind of scenario. The fact that the 'startup' entry is there in the config, tells me that some such feature may have been attempted in nant.