Can I use Portable Class Libraries (PCL) with a Visual Studio Online build server?

I am trying to use the Hosted Builder server from Visual Studio Online. I am using Visual Studio 2015.

Everything works fine until I turn on the Portable Class Library Library (PCL). I get errors related to AssemblyInfo.cs file:

Source\TestprojectSolution\TestprojectPCL\Properties\AssemblyInfo.cs (9, 12)
        The type or namespace name 'AssemblyTitle' could not be found (are you missing a using directive or an assembly reference?)
    Source\TestprojectSolution\TestprojectPCL\Properties\AssemblyInfo.cs (10, 12)
    The type or namespace name 'AssemblyDescription' could not be found (are you missing a using directive or an assembly reference?)
    Source\TestprojectSolution\TestprojectPCL\Properties\AssemblyInfo.cs (11, 12)
    The type or namespace name 'AssemblyConfiguration' could not be found (are you missing a using directive or an assembly reference?)
    Source\TestprojectSolution\TestprojectPCL\Properties\AssemblyInfo.cs (12, 12)
    The type or namespace name 'AssemblyCompany' could not be found (are you missing a using directive or an assembly reference?)
    Source\TestprojectSolution\TestprojectPCL\Properties\AssemblyInfo.cs (13, 12)
    The type or namespace name 'AssemblyProduct' could not be found (are you missing a using directive or an assembly reference?)
    Source\TestprojectSolution\TestprojectPCL\Properties\AssemblyInfo.cs (14, 12)
    The type or namespace name 'AssemblyCopyright' could not be found (are you missing a using directive or an assembly reference?)
    Source\TestprojectSolution\TestprojectPCL\Properties\AssemblyInfo.cs (15, 12)
    The type or namespace name 'AssemblyTrademark' could not be found (are you missing a using directive or an assembly reference?)
    Source\TestprojectSolution\TestprojectPCL\Properties\AssemblyInfo.cs (16, 12)
    The type or namespace name 'AssemblyCulture' could not be found (are you missing a using directive or an assembly reference?)
    Source\TestprojectSolution\TestprojectPCL\Properties\AssemblyInfo.cs (17, 12)
    The type or namespace name 'NeutralResourcesLanguage' could not be found (are you missing a using directive or an assembly reference?)
    Source\TestprojectSolution\TestprojectPCL\Properties\AssemblyInfo.cs (29, 12)
    The type or namespace name 'AssemblyVersion' could not be found (are you missing a using directive or an assembly reference?)

Can I use PCL togehter with a hosted build server? If so, how can I do this?

+4
source share
2 answers

I just answered this question here: fooobar.com/questions/1613627 / ...

, , , NuGet Build project.lock.json project.json. Microsoft NuGet , project.lock.json .

+4

, , .

VS2013, nuget. VS2013 .nuget xml- . " " nuget msbuild.

xml cproj, :

<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
    <PropertyGroup>
      <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
    </PropertyGroup>
    <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
  </Target>

xml- ( ), .

. : https://docs.nuget.org/consume/package-restore#automatic-package-restore-in-visual-studio ( , ; -))

, !

0

Source: https://habr.com/ru/post/1613624/


All Articles