Question

Hello I am having trouble building a x86 solution on Server 2008 r2 x64 with vs 2012 installed. It always errors out with the below errors:

  [msbuild] "C:\fake.sln" (Build target) (1) ->
  [msbuild] "C:\fake.csproj.metaproj" (default target) (2) ->
  [msbuild] "C:\fake.csproj" (default target) (8) ->
  [msbuild] "C:\xeqodvbc.tmp_proj" (_CompileTemporaryAssembly target) (11) ->
  [msbuild] (CoreCompile target) -> 
  [msbuild]   error CS1607 : Warning as error : Assembly generation -- Referenced assembly 'PresentationCore.dll' targets a different processor [C:\xeqodvbc.tmp_proj]
  [msbuild]   error CS1607 : Warning as error : Assembly generation -- Referenced assembly 'System.Data.dll' targets a different processor [C:\xeqodvbc.tmp_proj]

Below is the nant task that is failing. (I have changed the project names) All the Set3.5 target does is set the msbuild.targetframework property to v3.5.

<target name="faketarget" depends="makeTempDir" description="builds">
    <call target="set3.5" />
    <msbuild project="our32bit.sln" target="Build" verbosity="${msbuild.verbosity}">
        <property name="Configuration" value="${build.configuration}" />
        <property name="Platform" value="x86" />
        <property name="PlatformTarget" value="x86" />
        <!--<property name="Platform" value="${build.platform}" />-->
        <property name="RunCodeAnalysis" value="${code.analysis}" />
        <property name="CodeAnalysisRules" value="${code.analysis.rules}" />
        <property name="TargetFrameworkVersion" value="${msbuild.targetframework}" />
    </msbuild>

Now If I go into the solution's folder and call msbuild /p:TargetFrameworkVersion=v3.5 it builds no problem and if I open it in VS 2012 I can build it from there as well. Any suggestions?

Was it helpful?

Solution

I have solved this and I'm not sure if this an internal nant contrib issue or I just didn't do it correctly.

To solve this I had to create an exec task that pointed to the msbuild installed at C:\Windows\Microsoft.NET\Framework\v4.0.30319.

When i would run the msbuild task it used this path C:\Windows\Microsoft.NET\Framework64\v4.0.30319

So internally I think nant is defaulting to the 64 bit path on 64 bit machines.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top