Конвертировать скрипт сборки из VS2008 в VS2015 - PullRequest
0 голосов
/ 10 июня 2018

Я работаю над обновлением с VS2008 до VS2015.В VS2015 все прекрасно, теперь пришло время получить скрипт сборки, который используется для работы кода релиза.При запуске "msbuild BuildReleaseVS2015.proj / target: CoreApplicatrion" я получаю эту ошибку:

BuildReleaseVS2015.proj(67,5): error MSB4036: The "VCBuild" task was not found. Check the following: 
1.) The name of the task in the project file is the same as the name of the task class. 
2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 
3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Program Files (x86)\MSBuild\14.0\bin" directory.

Вот часть файла проекта:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.6.2" DefaultTargets="All" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <PropertyGroup>
    <CppIncludes>..\include</CppIncludes>
    <LibsPath>..\lib</LibsPath>    
  </PropertyGroup>

  <Target Name="licenseMgr_v141">
    <Message Text="*** Target licenseMgr v141" />
    <VCBuild Projects="..\licenseMgr\LicenseLib\LicenseLib.vcxproj" Configuration="Release_v141" Rebuild="true"/>
    <VCBuild Projects="..\licenseMgr\LicenseLib\LicenseLib.vcxproj" Configuration="Debug_v141" Rebuild="true"/>
  </Target>

  <Target Name="CoreApplicatrion" DependsOnTargets="licenseMgr_v141">
    <Message Text="*** Target CoreApplicatrion" />
    <MSBuild Projects="CA\CoreApplicatrion.sln" Properties="Configuration=Release"/>
  </Target>

</Project>

Я прошел MSDN ине могу понять, что мне не хватает, какие-либо мысли?

1 Ответ

0 голосов
/ 11 июня 2018

Преобразование сценария сборки из VS2008 в VS2015

Это потому, что последней Visual Studio, поддерживающей VCBuild, является VS2008 , поэтому при преобразовании сценария сборки изVS2008 - VS2015, вы получите ошибку:

"Задача" VCBuild "не найдена"

Чтобы решить эту проблему, вы можете использовать MSBuild вместо VCBuild, тогда цель должна быть такой:

<MSBuild  Projects="YourProject.vcxproj" Targets="Build" Properties="Configuration=$(Configuration);Platform=$(Platform)" />

Ваша цель:

  <Target Name="licenseMgr_v141">
    <Message Text="*** Target licenseMgr v141" />
    <MSBuild Projects="..\licenseMgr\LicenseLib\LicenseLib.vcxproj" Configuration="Release_v141" Targets="Build"/>
    <MSBuild Projects="..\licenseMgr\LicenseLib\LicenseLib.vcxproj" Configuration="Debug_v141" Targets="Build"/>
  </Target>

Надеюсь, это поможет.

...