referencing mixed platform 3rd party assembly in custom task creation
Munawar Rashid <[email protected]> Mon, 28 Oct 2013 17:15:02 -0400
| Newsgroups | gmane.comp.windows.dotnet.nant.user |
|---|---|
| Message-ID | <[email protected]> |
--===============7041021840242913520==
Content-Type: multipart/alternative;
boundary="_fbbb4d31-f68c-4650-bea4-0b2cf157e097_"
--_fbbb4d31-f68c-4650-bea4-0b2cf157e097_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi=2C
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=2C=
but with following warning.
There was a mismatch between the processor architecture of the project bein=
g built "MSIL" and the processor architecture of the reference "SharpSvn"=
=2C "x86". This mismatch may cause runtime failures. Please consider changi=
ng the targeted processor architecture of your project through the Configur=
ation Manager so as to align the processor architectures between your proje=
ct and references=2C or take a dependency on references with a processor ar=
chitecture that matches the targeted processor architecture of your project=
. =20
Then when I run the task=2C it is failing with following message
System.IO.FileNotFoundException: Could not load file or assembly 'SharpSvn=
=2C Version=3D1.7002.1998.12257=2C Culture=3Dneutral=2C PublicKeyToken=3Dd7=
29672594885a28' or one of its dependencies. The system cannot find the file=
specified.
File name: 'SharpSvn=2C Version=3D1.7002.1998.12257=2C Culture=3Dneutral=2C=
PublicKeyToken=3Dd729672594885a28'
at XXX.Build.NAnt.CustomTasks.getSVNRevisionListTask.ExecuteTask()
at NAnt.Core.Task.Execute()
at NAnt.Core.Target.Execute()
at NAnt.Core.Project.Execute(String targetName=2C Boolean forceDependenc=
ies)
at NAnt.Core.Project.Execute()
at NAnt.Core.Project.Run()
Per somebody's suggestion in an online forum=2C I created a dll config file=
with the following content.
<startup useLegacyV2RuntimeActivationPolicy=3D"true">
<supportedRuntime version=3D"v4.0"/>
</startup>
But the problem persists. I also noted that nant.exe.config also has this e=
ntry=2C but without the useLegacyV2RuntimeActivationPolicy setting.
The SharpSVN dll should target win32/x86 platform. Although=2C I'm trying o=
ut the custom task in a widows server 2008 r2 server=2C I couldn't get the =
reference to x64 version of the dll to work with a console app=2C I was try=
ing out earlier=2C leading me to stick with the x86 version.=20
Has anybody faced similar issue with referencing assemblies for custom task=
that may not be compiled with anycpu platform setting. Does NAnt have an i=
ntrinsic way to deal with this kind of scenario. The fact that the 'startup=
' entry is there in the config=2C tells me that some such feature may have =
been attempted in nant.
=
--_fbbb4d31-f68c-4650-bea4-0b2cf157e097_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<style><!--
.hmmessage P
{
margin:0px=3B
padding:0px
}
body.hmmessage
{
font-size: 12pt=3B
font-family:Calibri
}
--></style></head>
<body class=3D'hmmessage'><div dir=3D'ltr'>Hi=2C<br><br>I'm trying to creat=
e 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 indiv=
idual task class files are bound to. It compiles fine=2C but with following=
warning.<br><br>There was a mismatch between the processor architecture of=
the project being built "MSIL" and the processor architecture of the refer=
ence "SharpSvn"=2C "x86". This mismatch may cause runtime failures. Please =
consider changing the targeted processor architecture of your project throu=
gh the Configuration Manager so as to align the processor architectures bet=
ween your project and references=2C or take a dependency on references with=
a processor architecture that matches the targeted processor architecture =
of your project. =3B =3B <br><br>Then when I run the task=2C it is =
failing with following message<br><br>System.IO.FileNotFoundException: Coul=
d not load file or assembly 'SharpSvn=2C Version=3D1.7002.1998.12257=2C Cul=
ture=3Dneutral=2C PublicKeyToken=3Dd729672594885a28' or one of its dependen=
cies. The system cannot find the file specified.<br>File name: 'SharpSvn=2C=
Version=3D1.7002.1998.12257=2C Culture=3Dneutral=2C PublicKeyToken=3Dd7296=
72594885a28'<br> =3B =3B at XXX.Build.NAnt.CustomTasks.getSVNRevisi=
onListTask.ExecuteTask()<br> =3B =3B at NAnt.Core.Task.Execute()<br=
> =3B =3B at NAnt.Core.Target.Execute()<br> =3B =3B at NAnt=
.Core.Project.Execute(String targetName=2C Boolean forceDependencies)<br>&n=
bsp=3B =3B at NAnt.Core.Project.Execute()<br> =3B =3B at NAnt.C=
ore.Project.Run()<br><br>Per somebody's suggestion in an online forum=2C I =
created a dll config file with the following content.<br><br> =3B <=
=3Bstartup useLegacyV2RuntimeActivationPolicy=3D"true">=3B<br> =3B&nb=
sp=3B =3B <=3BsupportedRuntime version=3D"v4.0"/>=3B<br> =3B &l=
t=3B/startup>=3B<br><br>But the problem persists. I also noted that nant.=
exe.config also has this entry=2C but without the useLegacyV2RuntimeActivat=
ionPolicy setting.<br><br>The SharpSVN dll should target win32/x86 platform=
. Although=2C I'm trying out the custom task in a widows server 2008 r2 ser=
ver=2C I couldn't get the reference to x64 version of the dll to work with =
a console app=2C I was trying out earlier=2C leading me to stick with the x=
86 version. <br><br>Has anybody faced similar issue with referencing assemb=
lies 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 fa=
ct that the 'startup' entry is there in the config=2C tells me that some su=
ch feature may have been attempted in nant.<br><br><br><br> </di=
v></body>
</html>=
--_fbbb4d31-f68c-4650-bea4-0b2cf157e097_--
--===============7041021840242913520==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
--===============7041021840242913520==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
NAnt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-users
--===============7041021840242913520==--