Not able to Run Rest Automation Project through Command line

  • Thread starter Thread starter Raju Ghodake
  • Start date Start date
R

Raju Ghodake

Guest
Actually Rest Automation Project’s toolsversion is 14.0 and following are the commands to compile and run in visual

Studio 2015 (Projects created in VS 2015 has toolsversion 14.0)

It works fine in VS 2015

Compile

c:\Projects\Genscape\Repository\RestAutomation>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe /m project.targets /t:compile /toolsversion:14.0

Run

c:\Projects\Genscape\Repository\RestAutomation>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe /m project.targets /t:quick /toolsversion:14.0

--------------------------------------------------------------------------------------------------------------------------------------------------------------

but when I compile with same command in VS 2017

C:\Projects\Genscape\Repository\restautomation>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe /m project.targets /t:compile /toolsversion:14.0

Microsoft (R) Build Engine version 4.7.3056.0

[Microsoft .NET Framework, version 4.0.30319.42000]

Copyright (C) Microsoft Corporation. All rights reserved.

Build started 2/22/2019 2:44:25 PM.

1>Project "C:\Projects\Genscape\Repository\restautomation\project.targets" on node 1 (compile target(s)).

1>C:\Projects\Genscape\Repository\BuildTools\BuildUtils\common.environment.targets(14,2): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\CodeAnalysis\Microsoft.CodeAnalysis.Targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the

file exists on disk. [C:\Projects\Genscape\Repository\restautomation\project.targets]

1>Done Building Project "C:\Projects\Genscape\Repository\restautomation\project.targets" (compile target(s)) -- FAILED.

Build FAILED.

"C:\Projects\Genscape\Repository\restautomation\project.targets" (compile target) (1) ->

C:\Projects\Genscape\Repository\BuildTools\BuildUtils\common.environment.targets(14,2): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Mi

crosoft\VisualStudio\v14.0\CodeAnalysis\Microsoft.CodeAnalysis.Targets" was not found. Confirm that the path in the <Import> declaration is correct, and that th

e file exists on disk. [C:\Projects\Genscape\Repository\restautomation\project.targets]

0 Warning(s)

1 Error(s)

If I changed the toolversion 15.0

C:\Projects\Genscape\Repository\restautomation>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe /m project.targets /t:compile /toolsversion:15.0

Microsoft (R) Build Engine version 4.7.3056.0

[Microsoft .NET Framework, version 4.0.30319.42000]

Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1040: ToolsVersion is not valid. The tools version "15.0" is unrecognized. Available tools versions are "14.0", "4.0".

Switch: 15.0

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

And finally I use following command

C:\Projects\Genscape\Repository\restautomation\src>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe

C:\Projects\Genscape\Repository\restautomation\src>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe"

It compile successfully . . .

As you can see there are two msbuild versions in my machine

So I am very badly stuck in how to Run Project in VS 2017.

Continue reading...
 
Back
Top