Eto: لا يمكن بناء حالة تافهة في لينكس

تم إنشاؤها على ٦ أبريل ٢٠١٨  ·  16تعليقات  ·  مصدر: picoe/Eto

سلوك متوقع

يمكنني البناء مع dotnet

السلوك الفعلي

لا يمكنني البناء باستخدام dotnet

خطوات إعادة إظهار المشكلة

  1. قم بتثبيت dotnet-sdk-2.0.0
  2. تثبيت mono-devel
  3. تثبيت أحادي كامل
  4. dotnet new -i "Eto.Forms.Templates :: *"
  5. dotnet الجديد etoapp -g -sln
  6. استعادة دوت نت
  7. بناء دوت نت

الكود الذي يوضح المشكلة

[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.

ملاحظة: هذا غير مستحسن ، لأن بعض الميزات مفقودة أو لا تعمل على net core ، على سبيل المثال WebView. @ cra0zy يمكن أن يخبرك عن هذا أكثر.

لا .... كل شيء يعمل على .NET Core بما في ذلك WebView.

ال 16 كومينتر

شكرا للإبلاغ عن هذه المسألة. ومع ذلك ، فأنت بحاجة إلى استخدام msbuild بدلاً من dotnet build .

هذا مشغول. عندما حاولت نفس الشيء مع 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.

ربما يجب أن نضيف ذلك في دليل البدء السريع أنه لا يمكنك استخدام بناء dotnet.

voronoipotato nuget restore .
يجب تثبيت الأمر NuGet مع أحادي كامل ، ولكن إذا لم يكن كذلك ، فيمكنك تثبيته بشكل منفصل.

إذا كنت بحاجة فقط إلى دعم نظام 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>

ملاحظة: هذا غير مستحسن ، لأن بعض الميزات مفقودة أو لا تعمل على net core ، على سبيل المثال WebView .

voronoipotato قم بإنشاء ملف .csproj وليس ملف الحل. يبدو أن الحل يحتوي على مشروع Mac ، وهذا سيفشل دائمًا في البناء على Linux.

ملاحظة: هذا غير مستحسن ، لأن بعض الميزات مفقودة أو لا تعمل على net core ، على سبيل المثال WebView. @ cra0zy يمكن أن يخبرك عن هذا أكثر.

لا .... كل شيء يعمل على .NET Core بما في ذلك WebView.

يبدو أن الحل يحتوي على مشروع Mac ، وهذا سيفشل دائمًا في البناء على Linux.

في الواقع ، هذا غير صحيح. لم تعد مشاريع mac تستخدم نوع مشروع MonoMac الذي تم إيقافه وتستخدم csproj على غرار sdk. تتضمن حزم nuget من Eto الآن ملفات .targets التي ستنشئ حزمة .app لك حتى على نظامي التشغيل Windows أو Linux. ومع ذلك ، سيظل مشروع Xamarin.Mac الاختياري مبنيًا فقط على جهاز Mac.

ربما يجب أن نضيف ذلك في دليل البدء السريع أنه لا يمكنك استخدام بناء dotnet

منجز! لقد أضفت nuget restore و msbuild إلى المثال لتوجيه الأشخاص في الاتجاه الصحيح هناك.

آه ، اعتقدت أنه كان ينشئ الحلول لكل نظام أساسي ، وما زلت لم يجرب القوالب الجديدة حقًا.

voronoipotato هل هذا يعمل من أجلك الآن باستخدام nuget / msbuild؟

لقد أنشأت أيضًا # 1080 لنقل ملفات .targets لدعم dotnet build في المستقبل.

أنا أيضًا لست قادرًا على بناء حالة تافهة.

خطوات التكاثر

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

نظام

فيدورا 27 x86_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 .

وفقًا للوثائق الخاصة باستعادة الحزمة ، يتم تشغيلها أيضًا بواسطة 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>

نعم ، قد تكون فكرة جيدة كحالة اختبار أن تتعامل مع جهاز vm نظيف مع dotnet core و mono لمعرفة الأشياء التي تحتاجها حقًا لبناء هذا.

@ cra0zy dotnet restore لا يدعم bund.config ، التي تحتاجها قوالب F #. ومع ذلك ، أدركت للتو أن القوالب الموجودة على nuget لم يتم تحديثها إلى 2.4.1 (وهي في 2.4.0) ، والتي قمت بإزالة متطلبات تكوين الحزم لأن أدوات F # تدعمها الآن بشكل صحيح.

يجب أن تكون ثابتة بالرقم 1104.

شكرا للإبلاغ عن هذه المسألة!

هل كانت هذه الصفحة مفيدة؟
0 / 5 - 0 التقييمات