Eto: Linuxで些細なケースを構築することはできません

作成日 2018年04月06日  ·  16コメント  ·  ソース: picoe/Eto

予想される行動

dotnetで構築できます

実際の動作

dotnetでビルドできません

問題を再現する手順

  1. dotnet-sdk-2.0.0をインストールします
  2. mono-develをインストールします
  3. モノコンプリートをインストール
  4. dotnet new -i "Eto.Forms.Templates :: *"
  5. dotnet new etoapp -g -sln
  6. dotnetの復元
  7. dotnetビルド

問題を示すコード

[alan<strong i="19">@localhost</strong> Testing]$ dotnet new etoapp -g -sln
The template "Eto App" was created successfully.
[alan<strong i="20">@localhost</strong> Testing]$ dotnet restore
  Restoring packages for /home/alan/Documents/Testing/Testing.Desktop/Testing.Desktop.csproj...
  Restoring packages for /home/alan/Documents/Testing/Testing/Testing.csproj...
  Generating MSBuild file /home/alan/Documents/Testing/Testing.Desktop/obj/Testing.Desktop.csproj.nuget.g.props.
  Generating MSBuild file /home/alan/Documents/Testing/Testing.Desktop/obj/Testing.Desktop.csproj.nuget.g.targets.
  Generating MSBuild file /home/alan/Documents/Testing/Testing/obj/Testing.csproj.nuget.g.props.
  Generating MSBuild file /home/alan/Documents/Testing/Testing/obj/Testing.csproj.nuget.g.targets.
  Restore completed in 302.81 ms for /home/alan/Documents/Testing/Testing/Testing.csproj.
  Restore completed in 296.78 ms for /home/alan/Documents/Testing/Testing.Desktop/Testing.Desktop.csproj.
[alan<strong i="21">@localhost</strong> Testing]$ dotnet build
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Testing -> /home/alan/Documents/Testing/Testing/bin/Debug/netstandard1.6/Testing.dll
  Testing.Desktop -> /home/alan/Documents/Testing/Testing.Desktop/bin/Debug/net461/Testing.Desktop.exe
  Creating Testing.Desktop.app in target directory
/home/alan/.nuget/packages/eto.platform.mac64/2.4.0/build/MacTemplate.targets(115,3): error : MSB4801: The task factory "CodeTaskFactory" is not supported on the .NET Core version of MSBuild. [/home/alan/Documents/Testing/Testing.Desktop/Testing.Desktop.csproj]
/home/alan/.nuget/packages/eto.platform.mac64/2.4.0/build/MacTemplate.targets(115,3): error MSB4036: The "_UpdatePList" 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 "/usr/share/dotnet/sdk/2.0.0" directory. [/home/alan/Documents/Testing/Testing.Desktop/Testing.Desktop.csproj]

Build FAILED.

/home/alan/.nuget/packages/eto.platform.mac64/2.4.0/build/MacTemplate.targets(115,3): error : MSB4801: The task factory "CodeTaskFactory" is not supported on the .NET Core version of MSBuild. [/home/alan/Documents/Testing/Testing.Desktop/Testing.Desktop.csproj]
/home/alan/.nuget/packages/eto.platform.mac64/2.4.0/build/MacTemplate.targets(115,3): error MSB4036: The "_UpdatePList" 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 "/usr/share/dotnet/sdk/2.0.0" directory. [/home/alan/Documents/Testing/Testing.Desktop/Testing.Desktop.csproj]
    0 Warning(s)
    2 Error(s)

特にこの行は重要なようです。
The task factory "CodeTaskFactory" is not supported on the .NET Core version of MSBuild.

仕様

  • バージョン:2.4.0
  • プラットフォーム:(Fedora Gtk3)

最も参考になるコメント

@voronoipotatoソリューションファイルではなく、.csprojファイルをビルドします。 ソリューションにはMacプロジェクトが含まれているようですが、Linuxでのビルドは常に失敗します。

注:WebViewなど、一部の機能が欠落しているか、ネットコアで機能しないため、これはお勧めしません。 @ cra0zyはこれについてもっと教えてくれます。

いいえ.... WebViewを含むすべてが.NETCoreで動作します。

全てのコメント16件

問題を報告していただきありがとうございます。 ただし、 dotnet build msbuildを使用する必要があります。

それはうまくいった。 F#でも同じことを試したとき
dotnet new etoapp -g -sln -lang F#
それから私は得る

/home/alan/Documents/Testing/Testing.Desktop/Testing.Desktop.fsproj(124,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ../packages/Eto.Forms.2.4.0/build/Eto.Forms.targets.
Done Building Project "/home/alan/Documents/Testing/Testing.Desktop/Testing.Desktop.fsproj" (default targets) -- FAILED.
Done Building Project "/home/alan/Documents/Testing/Testing.sln" (default targets) -- FAILED.

Build FAILED.

"/home/alan/Documents/Testing/Testing.sln" (default target) (1) ->
"/home/alan/Documents/Testing/Testing.Desktop/Testing.Desktop.fsproj" (default target) (3) ->
(EnsureNuGetPackageBuildImports target) -> 
  /home/alan/Documents/Testing/Testing.Desktop/Testing.Desktop.fsproj(124,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ../packages/Eto.Forms.2.4.0/build/Eto.Forms.targets.

    0 Warning(s)
    1 Error(s)

msbuildで。

おそらく、ドットネットビルドを使用できないことをクイックスタートガイドに追加する必要があります。

@voronoipotato nuget restore
NuGetコマンドはmono-completeでインストールする必要がありますが、そうでない場合は個別にインストールできます。

Linuxプラットフォームのみをサポートする必要がある場合は、 Eto.Platform.Gtk nugetとターゲットnetcoreapp2.0を使用でき、 dotnet buildを使用してビルドできます。

これが私のcsprojの例です:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Eto.Platform.Gtk" Version="2.4.1" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\Eto.Desktop\Eto.Desktop.csproj" />
  </ItemGroup>

</Project>

注: WebViewなど、一部の機能が欠落しているか、ネットコアで機能しないため、これはお勧めしません。

@voronoipotatoソリューションファイルではなく、.csprojファイルをビルドします。 ソリューションにはMacプロジェクトが含まれているようですが、Linuxでのビルドは常に失敗します。

注:WebViewなど、一部の機能が欠落しているか、ネットコアで機能しないため、これはお勧めしません。 @ cra0zyはこれについてもっと教えてくれます。

いいえ.... WebViewを含むすべてが.NETCoreで動作します。

ソリューションにはMacプロジェクトが含まれているようですが、Linuxでのビルドは常に失敗します。

実際、それは正しくありません。 Macプロジェクトは、非推奨のMonoMacプロジェクトタイプを使用せず、sdkスタイルのcsprojを使用します。 Etoのnugetパッケージには、WindowsまたはLinuxでも.appバンドルをビルドする.targetsファイルが含まれるようになりました。 ただし、オプションのXamarin.Macプロジェクトは、引き続きMac上でのみビルドされます。

おそらく、ドットネットビルドを使用できないことをクイックスタートガイドに追加する必要があります

終わり! 例にnuget restoremsbuildを追加して、人々を正しい方向に向けます。

ああ、私は彼がプラットフォームごとのソリューションを生成していると思っていましたが、まだ新しいテンプレートを実際に試していません。

@voronoipotatoは、nuget / msbuildを使用して機能していますか?

また、将来dotnet buildをサポートするために.targetsファイルを移植するために#1080を作成しました。

私も些細なケースを作ることができません。

再現する手順

mkdir -p eto-test
cd eto-test
dotnet new -i "Eto.Forms.Templates::*"
dotnet new etoapp -lang F#
nuget restore
msbuild

何が起こるのですか

Microsoft (R) Build Engine version 15.4.0.0 ( Wed Nov 29 14:47:19 UTC 2017) for Mono
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 4/13/2018 9:34:26 AM.
Project "[…]/eto-test/eto-test.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Debug|Any CPU".
Project "[…]/eto-test/eto-test.sln" (1) is building "[…]/eto-test/eto-test/eto-test.fsproj" (2) on node 1 (default targets).
PrepareForBuild:
  Creating directory "bin/Debug/net45/".
  Creating directory "obj/Debug/net45/".
/usr/share/dotnet/sdk/2.0.3/Sdks/Microsoft.NET.Sdk/build/Microsoft.PackageDependencyResolution.targets(323,5): error : Assets file '[…]/eto-test/eto-test/obj/project.assets.json' not found. Run a NuGet package restore to generate this file. [[…]/eto-test/eto-test/eto-test.fsproj]
  Build continuing because "ContinueOnError" on the task "ReportAssetsLogMessages" is set to "ErrorAndContinue".
/usr/share/dotnet/sdk/2.0.3/Sdks/Microsoft.NET.Sdk/build/Microsoft.PackageDependencyResolution.targets(165,5): error : Assets file '[…]/eto-test/eto-test/obj/project.assets.json' not found. Run a NuGet package restore to generate this file. [[…]/eto-test/eto-test/eto-test.fsproj]
Done Building Project "[…]/eto-test/eto-test/eto-test.fsproj" (default targets) -- FAILED.
Project "[…]/eto-test/eto-test.sln" (1) is building "[…]/eto-test/eto-test.Desktop/eto-test.Desktop.fsproj" (3) on node 1 (default targets).
GenerateFSharpTextResources:
  Creating directory "obj/Debug/".
PrepareForBuild:
  Creating directory "bin/Debug/".
Done Building Project "[…]/eto-test/eto-test.Desktop/eto-test.Desktop.fsproj" (default targets) -- FAILED.
Done Building Project "[…]/eto-test/eto-test.sln" (default targets) -- FAILED.

Build FAILED.

"[…]/eto-test/eto-test.sln" (default target) (1) ->
"[…]/eto-test/eto-test/eto-test.fsproj" (default target) (2) ->
(ReportAssetsLogMessages target) -> 
  /usr/share/dotnet/sdk/2.0.3/Sdks/Microsoft.NET.Sdk/build/Microsoft.PackageDependencyResolution.targets(323,5): error : Assets file '[…]/eto-test/eto-test/obj/project.assets.json' not found. Run a NuGet package restore to generate this file. [[…]/eto-test/eto-test/eto-test.fsproj]


"[…]/eto-test/eto-test.sln" (default target) (1) ->
"[…]/eto-test/eto-test/eto-test.fsproj" (default target) (2) ->
(RunResolvePackageDependencies target) -> 
  /usr/share/dotnet/sdk/2.0.3/Sdks/Microsoft.NET.Sdk/build/Microsoft.PackageDependencyResolution.targets(165,5): error : Assets file '[…]/eto-test/eto-test/obj/project.assets.json' not found. Run a NuGet package restore to generate this file. [[…]/eto-test/eto-test/eto-test.fsproj]

    0 Warning(s)
    2 Error(s)

Time Elapsed 00:00:01.66

システム

Fedora 27x86_64。

dnf repository-packages packages-microsoft-com-prod list installedは以下を返します:

aspnetcore-store-2.0.0.x86_64            2.0.0-1             @packages-microsoft-com-prod
aspnetcore-store-2.0.3.x86_64            2.0.3-1             @packages-microsoft-com-prod
dotnet-host.x86_64                       2.0.6-1             @packages-microsoft-com-prod
dotnet-hostfxr-2.0.3.x86_64              2.0.3-1             @packages-microsoft-com-prod
dotnet-runtime-2.0.3.x86_64              2.0.3-1             @packages-microsoft-com-prod
dotnet-sdk-2.0.3.x86_64                  2.0.3-1             @packages-microsoft-com-prod

dnf repository-packages mono-centos7-stable list installedは以下を返します:

fsharp.noarch              4.1.33-0.xamarin.2.epel7                               @mono-centos7-stable
libgdiplus0.x86_64         4.2-0.xamarin.2.epel7                                  @mono-centos7-stable
libmonosgen-2_0-1.x86_64   5.10.1.20-0.xamarin.3.epel7                            @mono-centos7-stable
mono-core.x86_64           5.10.1.20-0.xamarin.3.epel7                            @mono-centos7-stable
mono-data.x86_64           5.10.1.20-0.xamarin.3.epel7                            @mono-centos7-stable
mono-data-oracle.x86_64    5.10.1.20-0.xamarin.3.epel7                            @mono-centos7-stable
mono-data-sqlite.x86_64    5.10.1.20-0.xamarin.3.epel7                            @mono-centos7-stable
mono-devel.x86_64          5.10.1.20-0.xamarin.3.epel7                            @mono-centos7-stable
mono-extras.x86_64         5.10.1.20-0.xamarin.3.epel7                            @mono-centos7-stable
mono-mvc.x86_64            5.10.1.20-0.xamarin.3.epel7                            @mono-centos7-stable
mono-wcf.x86_64            5.10.1.20-0.xamarin.3.epel7                            @mono-centos7-stable
mono-web.x86_64            5.10.1.20-0.xamarin.3.epel7                            @mono-centos7-stable
mono-winforms.x86_64       5.10.1.20-0.xamarin.3.epel7                            @mono-centos7-stable
mono-winfxcore.x86_64      5.10.1.20-0.xamarin.3.epel7                            @mono-centos7-stable
msbuild.noarch             1:15.4+xamarinxplat.2017.11.27.11.23-0.xamarin.1.epel7 @mono-centos7-stable
msbuild-libhostfxr.x86_64  2.0.0.2017.07.06.00.01-0.xamarin.1.epel7               @mono-centos7-stable
msbuild-sdkresolver.noarch 1:15.4+xamarinxplat.2017.11.27.11.23-0.xamarin.1.epel7 @mono-centos7-stable
nuget.noarch               2.12+mono-0.xamarin.3.epel7                            @mono-centos7-stable

エラーはすでに何が問題なのかを示しています...「NuGetパッケージの復元を実行してこのファイルを生成します。」そしていいえ、これはnuget restoreを実行することを意味するものではなく、そのコマンドはそのようには機能しません。 最も簡単な解決策は、 dotnet restoreを実行することです。

Package Restoreのドキュメントによると、 nuget restoreによってもトリガーされます。 とにかく、 dotnet restoreを実行すると、部分的なエラーが発生します。

[…]/eto-test/eto-test.Desktop/eto-test.Desktop.fsproj(57,3): error MSB4020: The value "" of the "Project" attribute in element <Import> is invalid.
[…]/eto-test/eto-test.Desktop/eto-test.Desktop.fsproj : warning NU1503: Skipping restore for project '[…]/eto-test/eto-test.Desktop/eto-test.Desktop.fsproj'. The project file may be invalid or missing targets required for restore. [[…]/eto-test/eto-test.sln]
[…]

これは、 msbuildを実行するときに問題を引き起こすようです:

/usr/lib/mono/fsharp/Microsoft.FSharp.Targets(181,9): error MSB4062: The "FSharpEmbedResXSource" task could not be loaded from the assembly /usr/lib/mono/fsharp/FSharp.Build.dll.  Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [[…]/eto-test/eto-test.Desktop/eto-test.Desktop.fsproj]
Done Building Project "[…]/eto-test/eto-test.Desktop/eto-test.Desktop.fsproj" (default targets) -- FAILED.
Done Building Project "[…]/eto-test/eto-test.sln" (default targets) -- FAILED.

Build FAILED.

"[…]/eto-test/eto-test.sln" (default target) (1) ->
"[…]/eto-test/eto-test.Desktop/eto-test.Desktop.fsproj" (default target) (3) ->
(GenerateFSharpTextResources target) -> 
  /usr/lib/mono/fsharp/Microsoft.FSharp.Targets(181,9): error MSB4062: The "FSharpEmbedResXSource" task could not be loaded from the assembly /usr/lib/mono/fsharp/FSharp.Build.dll.  Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [[…]/eto-test/eto-test.Desktop/eto-test.Desktop.fsproj]

    0 Warning(s)
    1 Error(s)

パッケージの復元に関するドキュメントによると、nugetの復元によってもトリガーされます。

nuget restoreは、復元ディレクトリとプロジェクトファイルが機能するために引数を必要とします。それは私が話していることです。それらなしでは実行できません(万が一変更されない限り)。

私の場合の問題は、 $(FSharpTargetsPath)が空であるということのようです。 .fsprojファイルは、この変数を設定するときに、Visual Studioがインストールされていると想定しているように見えるため、これは当然のことです。

<Choose>
  <When Condition="'$(VisualStudioVersion)' == '11.0'">
    <PropertyGroup Condition=" '$(FSharpTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets') ">
      <FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
    </PropertyGroup>
  </When>
  <Otherwise>
    <PropertyGroup Condition=" '$(FSharpTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets') ">
      <FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
    </PropertyGroup>
  </Otherwise>
</Choose>

はい、テストケースとして、dotnetコアとmonoを使用してクリーンなVMに対して実行し、これを構築するために実際に必要なものを確認することをお勧めします。

@ cra0zy dotnet restoreは、F#テンプレートで必要なpackages.configをサポートしていません。 ただし、nugetのテンプレートが2.4.1に更新されていないことに気付きました(2.4.0にあります)。F#ツールで適切にサポートされるようになったため、packages.config要件を削除しました。

#1104で修正する必要があります。

問題を報告していただきありがとうございます。

このページは役に立ちましたか?
0 / 5 - 0 評価