带有PCL的.NET Core 1.1应用程序,无法在团队服务上构建
我有以下关于解决方案的项目,这对我的本地工作非常好。带有PCL的.NET Core 1.1应用程序,无法在团队服务上构建
然而,当我在团队服务检查代码并创建构建失败。
mainconsole.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
<PackageTargetFallback>portable-net45+win8</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.Portable.Compatibility" Version="1.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\business\business.csproj" />
<ProjectReference Include="..\portableextensibility\portableextensibility.csproj" />
<ProjectReference Include="..\portablelibrary\portablelibrary.csproj" />
</ItemGroup>
</Project>
构建任务:
命令行 - 工具
dotnet
,参数 -restore
命令行 - 工具
dotnet
,参数 -build
,生成失败:
d:\ A \ 3 \ S \ portablelibrary \ portablelibrary.csproj(43,3):错误MSB4019:导入项目“C:\ Program Files文件\ DOTNET \ SDK \ 1.0.4 \ Microsoft \ Portable \ v4.5 \ Microsoft.Portable.CSharp.targets“找不到。确认声明中的路径是正确的,并且该文件存在于磁盘上。 d:\ a \ 3 \ s \ portableextensibility \ portableextensibility.csproj(42,3):error MSB4019:导入的项目“C:\ Program Files \ dotnet \ sdk \ 1.0.4 \ Microsoft \ Portable \ v4.5 \ Microsoft.Portable.CSharp.targets“未找到。确认声明中的路径是正确的,并且该文件存在于磁盘上。
C:\ Program Files \ dotnet \ sdk \ 1.0.4 \ NuGet.targets(97,5):error:Unable to resolve'd:\ a \ 3 \ s \ portableextensibility \ portableextensibility.csproj'for' .NETCoreApp,版本= 1.1' 版。 [d:\ a \ 3 \ s \ dotnetcompatibility.sln] C:\ Program Files \ dotnet \ sdk \ 1.0.4 \ NuGet.targets(97,5):error:Unable to resolve'd:\ a \ 3 \ '\ Portablelibrary \ portablelibrary.csproj'为'.NETCoreApp,版本= v1.1'。 [d:\ a \ 3 \ s \ dotnetcompatibility.sln]生成MSBuild文件d:\ a \ 3 \ s \ mainconsole \ obj \ mainconsole.csproj.nuget.g.props。生成MSBuild文件d:\ a \ 3 \ s \ mainconsole \ obj \ mainconsole.csproj.nuget.g.targets。将锁定文件写入磁盘。路径:d:\ a \ 3 \ s \ mainconsole \ obj \ project.assets.json对于d:\ a \ 3 \ s \ mainconsole \ mainconsole.csproj,在37.7秒内还原失败。 d:\ a \ 3 \ s \ business \ business.csproj中的错误无法为'.NETStandard,Version = v1.1'解析'd:\ a \ 3 \ s \ portablelibrary \ portablelibrary.csproj'。 d:\ a \ 3 \ s \ mainconsole \ mainconsole.csproj中的错误 无法为'.NETCoreApp,Version = v1.1'解析'd:\ a \ 3 \ s \ portableextensibility \ portableextensibility.csproj'。 无法为'.NETCoreApp,Version = v1.1'解析'd:\ a \ 3 \ s \ portablelibrary \ portablelibrary.csproj'。
由于该解决方案包含目前无法使用dotnet
CLI建PCL库,该项目必须通过msbuild
,而不是基于dotnet
命令来建立。
以防万一,如果你知道,有没有什么办法在竹子中配置Quest代理'托管2017年'。因为我在Team service中签入,所以'Hosted'代理失败。 – Kenz
呢'DOTNET build'工作在本地机器上?我相信它没有。 –
它的工作原理。我想呢?我从C:\ Program Files文件(x86)\ Microsoft Visual Studio \ 2017 \ Community \ MSBuild \ Microsoft \ Portable \复制到'C:\ Program Files \ dotnet \ sdk \ 1.0.4 \ Microsoft \ Portable' – Kenz
在这种情况下,'msbuild'(commandline)和'dotnet build'都可以使用。 – Kenz