Server 2016 msbuild errors

Ranorex Spy, Recorder, and Studio.
mvlismas
Posts: 6
Joined: Wed Apr 25, 2018 4:00 pm

Server 2016 msbuild errors

Post by mvlismas » Mon Oct 15, 2018 9:39 pm

Hello team,

I am currently trying to setup a Windows 2016 server to perform "continuous integration" for testing. Here is what is happening.
When I pull the source files on to the server, I have a CLI script that will run to build the Ranorex solution. On my Windows 10 workstation, the .Net 4.5.2 msbuild builds the exe with no errors or warnings. However, the same attempt on the Windows Server throws a bunch of warnings, then the exe does not run correctly.

Here are some of the warnings. How do I target the 4.5.2 version of msbuild on Server 2016? and how do I resolve these errors?

Code: Select all

  C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3247: Found conflicts betw
een different versions of the same dependent assembly. [C:\Users\admin\Desktop\Test-Software\Ranorex\Workstatio
nOnlineHelp\WorkstationOnlineHelp.csproj]

  C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3270: There was a mismatch
 between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "

C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll", "x86". This mismatch may cause runtime failures. Please co
nsider changing the targeted processor architecture of your project through the Configuration Manager so as to align th
e processor architectures between your project and references, or take a dependency on references with a processor arch
itecture that matches the targeted processor architecture of your project. [C:\Users\admin\Desktop\Test-Software\Ranore
x\WorkstationOnlineHelp\WorkstationOnlineHelp.csproj]

  C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3270: There was a mismatch
 between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "
System.Data", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor archit
ecture of your project through the Configuration Manager so as to align the processor architectures between your projec
t and references, or take a dependency on references with a processor architecture that matches the targeted processor
architecture of your project. [C:\Users\admin\Desktop\Test-Software\Ranorex\WorkstationOnlineHelp\Works
tationOnlineHelp.csproj]

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Server 2016 msbuild errors

Post by krstcs » Tue Oct 16, 2018 1:56 pm

You need to install .NET 4.5.2 on the server as Windows Server 2016 comes with 4.6.2 by default. Since there were changes in some of the libraries, your MSBuild can't find the right ones.

You should be able to install it from the server's Add Features option.
Shortcuts usually aren't...

mvlismas
Posts: 6
Joined: Wed Apr 25, 2018 4:00 pm

Re: Server 2016 msbuild errors

Post by mvlismas » Tue Oct 16, 2018 1:58 pm

I get that. But when I try to install .Net 4.5.2 it gives a message that it is already installed. What else?